mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Use separate representations for canonical repository vs. commit (#317)
Given `https://github.com/pypa/package.git#subdirectory=pkg_a` and `https://github.com/pypa/package.git#subdirectory=pkg_b`, we want these to map to the same shared _resource_ (for locking and cloning), but different _packages_ (for determining whether the wheel already exists in the cache). As such, we need two distinct concepts for "canonical equality". Closes #316.
This commit is contained in:
parent
b589813e59
commit
051188dce0
6 changed files with 192 additions and 25 deletions
|
@ -7,7 +7,7 @@ use anyhow::Result;
|
|||
use reqwest::Client;
|
||||
use tracing::debug;
|
||||
|
||||
use puffin_cache::{digest, CanonicalUrl};
|
||||
use puffin_cache::{digest, RepositoryUrl};
|
||||
|
||||
use crate::git::GitRemote;
|
||||
use crate::{FetchStrategy, Git};
|
||||
|
@ -36,7 +36,7 @@ impl GitSource {
|
|||
|
||||
pub fn fetch(self) -> Result<Fetch> {
|
||||
// The path to the repo, within the Git database.
|
||||
let ident = digest(&CanonicalUrl::new(&self.git.url));
|
||||
let ident = digest(&RepositoryUrl::new(&self.git.url));
|
||||
let db_path = self.cache.join("db").join(&ident);
|
||||
|
||||
let remote = GitRemote::new(&self.git.url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue