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:
Charlie Marsh 2024-04-02 20:24:29 -04:00 committed by GitHub
parent c30a65ee0c
commit 684f790d5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 104 additions and 54 deletions

View file

@ -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::*;