From 96ef9dbc2c1ae89e3326c053843e8c38f1340fe7 Mon Sep 17 00:00:00 2001 From: Ivan Shcheklein Date: Sun, 14 Jul 2024 16:58:15 -0700 Subject: [PATCH] fix(git): lock cache on resolve --- crates/uv-git/src/resolver.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/crates/uv-git/src/resolver.rs b/crates/uv-git/src/resolver.rs index b6f5440a50dc..75cc8150a88e 100644 --- a/crates/uv-git/src/resolver.rs +++ b/crates/uv-git/src/resolver.rs @@ -108,16 +108,7 @@ impl GitResolver { } } - // Fetch the precise SHA of the Git reference (which could be a branch, a tag, a partial - // commit, etc.). - let source = if let Some(reporter) = reporter { - GitSource::new(url.clone(), client, cache).with_reporter(reporter) - } else { - GitSource::new(url.clone(), client, cache) - }; - let fetch = tokio::task::spawn_blocking(move || source.fetch()) - .await? - .map_err(GitResolverError::Git)?; + let fetch = self.fetch(url, client, cache, reporter).await?; let git = fetch.into_git(); // Insert the resolved URL into the in-memory cache.