Closed Leonidas-from-XIV closed 1 year ago
I've decided to wrap the normalization in an abstract type to which the conversion only goes one way, to make sure the canonical URLs (whatever they might be) aren't used for other purposes.
@emillon You're right, that's a good point. I've simplified the whole thing to just parse user/repo out of github.com URLs and keep the rest the same.
It might make sense to remove the hash/branch, but in practice I doubt someone would specify a git repo with a hash as dev-repo
.
This PR tries to normalize the
dev-repo
URLs somewhat. @TheLortex reported in #118 that the.git
is differing between the repos so this PR tries to normalize the URLs:.git
in the repo pathgit+https
as scheme#main
)This is just a workaround since there is no way to make sure the URLs are equivalent without visiting them (especially the
.git
addition is a bit dodgy), but it should at least cover some common cases and in the worst case the canonicalization gives up and returns the input, thus equivalent to what was there before.Also turns out there was a
Uri_utils.has_git_extension
which I assume is somewhat related to the issue at hand, but it was unused so I removed it.Closes #118