Use hasher to compute resolution hash (#5495)

## Summary

Addressing one TODO. This should be more efficient.
This commit is contained in:
Charlie Marsh 2024-07-26 19:24:09 -04:00 committed by GitHub
parent e8d7c0cb58
commit 561625ed8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 78 additions and 69 deletions

View file

@ -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,
)?;

View file

@ -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);