Assume git+ prefix when URLs end in .git (#5868)

## Summary

Right now, this applies _everywhere_, so the following also works:

```
pip install "elmer-circuitbuilder @ https://github.com/ElmerCSC/elmer_circuitbuilder.git"
```

I actually think that's ok?

Closes https://github.com/astral-sh/uv/issues/5866.
This commit is contained in:
Charlie Marsh 2024-08-07 11:50:36 -04:00 committed by GitHub
parent dceba77ff7
commit 9a80dfeed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 89 additions and 1 deletions

View file

@ -347,6 +347,11 @@ impl TryFrom<Url> for ParsedUrl {
message: "Unknown scheme",
}),
}
} else if Path::new(url.path())
.extension()
.is_some_and(|ext| ext.eq_ignore_ascii_case("git"))
{
Ok(Self::Git(ParsedGitUrl::try_from(url)?))
} else if url.scheme().eq_ignore_ascii_case("file") {
let path = url
.to_file_path()