Skip to content

Commit

Permalink
Fix loading of cached metadata for git distributions with subdirector…
Browse files Browse the repository at this point in the history
…ies (#6094)

Applies the same fix as #5944 to
cache loads

Closes #6093
  • Loading branch information
zanieb committed Aug 14, 2024
1 parent 981b7ca commit dc67023
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/uv-distribution/src/source/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1226,12 +1226,18 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
.is_fresh()
{
if let Some(metadata) = read_cached_metadata(&metadata_entry).await? {
let path = if let Some(subdirectory) = resource.subdirectory {
Cow::Owned(fetch.path().join(subdirectory))
} else {
Cow::Borrowed(fetch.path())
};

debug!("Using cached metadata for: {source}");
return Ok(ArchiveMetadata::from(
Metadata::from_workspace(
metadata,
fetch.path(),
fetch.path(),
&path,
&path,
self.build_context.sources(),
self.preview_mode,
)
Expand Down

0 comments on commit dc67023

Please sign in to comment.