mirror of https://github.com/astral-sh/uv
Fix loading of cached metadata for git distributions with subdirectories (#6094)
Applies the same fix as https://github.com/astral-sh/uv/issues/5944 to cache loads Closes https://github.com/astral-sh/uv/issues/6093
This commit is contained in:
parent
981b7ca5ec
commit
dc67023677
|
|
@ -1226,12 +1226,18 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
||||||
.is_fresh()
|
.is_fresh()
|
||||||
{
|
{
|
||||||
if let Some(metadata) = read_cached_metadata(&metadata_entry).await? {
|
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}");
|
debug!("Using cached metadata for: {source}");
|
||||||
return Ok(ArchiveMetadata::from(
|
return Ok(ArchiveMetadata::from(
|
||||||
Metadata::from_workspace(
|
Metadata::from_workspace(
|
||||||
metadata,
|
metadata,
|
||||||
fetch.path(),
|
&path,
|
||||||
fetch.path(),
|
&path,
|
||||||
self.build_context.sources(),
|
self.build_context.sources(),
|
||||||
self.preview_mode,
|
self.preview_mode,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue