mirror of
https://github.com/astral-sh/uv.git
synced 2025-12-04 00:54:42 +00:00
Use hasher to compute resolution hash (#5495)
## Summary Addressing one TODO. This should be more efficient.
This commit is contained in:
parent
e8d7c0cb58
commit
561625ed8c
18 changed files with 78 additions and 69 deletions
|
|
@ -63,7 +63,7 @@ impl GitResolver {
|
|||
fs::create_dir_all(&lock_dir).await?;
|
||||
let repository_url = RepositoryUrl::new(url.repository());
|
||||
let _lock = LockedFile::acquire(
|
||||
lock_dir.join(cache_key::digest(&repository_url)),
|
||||
lock_dir.join(cache_key::cache_digest(&repository_url)),
|
||||
&repository_url,
|
||||
)?;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use reqwest_middleware::ClientWithMiddleware;
|
|||
use tracing::{debug, instrument};
|
||||
use url::Url;
|
||||
|
||||
use cache_key::{digest, RepositoryUrl};
|
||||
use cache_key::{cache_digest, RepositoryUrl};
|
||||
|
||||
use crate::git::GitRemote;
|
||||
use crate::{GitOid, GitSha, GitUrl};
|
||||
|
|
@ -53,7 +53,7 @@ impl GitSource {
|
|||
#[instrument(skip(self), fields(repository = %self.git.repository, rev = ?self.git.precise))]
|
||||
pub fn fetch(self) -> Result<Fetch> {
|
||||
// The path to the repo, within the Git database.
|
||||
let ident = digest(&RepositoryUrl::new(&self.git.repository));
|
||||
let ident = cache_digest(&RepositoryUrl::new(&self.git.repository));
|
||||
let db_path = self.cache.join("db").join(&ident);
|
||||
|
||||
let remote = GitRemote::new(&self.git.repository);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue