mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Preserve .git
suffixes and casing in Git dependencies (#2789)
## Summary I noticed in #2769 that I was now stripping `.git` suffixes from Git URLs after resolving to a precise commit. This PR cleans up the internal caching to use a better canonical representation: a `RepositoryUrl` along with a `GitReference`, instead of a `GitUrl` which can contain non-canonical data. This gives us both better fidelity (preserving the `.git`, along with any casing that the user provided when defining the URL) and is overall cleaner and more robust.
This commit is contained in:
parent
c30a65ee0c
commit
684f790d5d
7 changed files with 104 additions and 54 deletions
|
@ -165,6 +165,12 @@ impl Deref for RepositoryUrl {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for RepositoryUrl {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(&self.0, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue