diff --git a/crates/uv-extract/src/stream.rs b/crates/uv-extract/src/stream.rs index 2c4a9131c..5ab7e3d3e 100644 --- a/crates/uv-extract/src/stream.rs +++ b/crates/uv-extract/src/stream.rs @@ -206,9 +206,11 @@ pub async fn unzip( // Verify that the existing file contents match the expected contents. if existing_contents != expected_contents { - return Err(Error::DuplicateLocalFileHeader { - path: relpath.clone(), - }); + if !skip_validation { + return Err(Error::DuplicateLocalFileHeader { + path: relpath.clone(), + }); + } } (bytes_read as u64, entry_reader) @@ -455,9 +457,11 @@ pub async fn unzip( } std::collections::hash_map::Entry::Occupied(entry) => { if mode != *entry.get() { - return Err(Error::DuplicateExecutableFileHeader { - path: relpath.clone(), - }); + if !skip_validation { + return Err(Error::DuplicateExecutableFileHeader { + path: relpath.clone(), + }); + } } } }