From e6ba9f1da0e1fa966dd5571fa894db566bb72224 Mon Sep 17 00:00:00 2001 From: Arslan <49312804+marschattha@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:30:08 +0500 Subject: [PATCH] Allow raw coverage files with same name (#1424) Right now if someone has two coverage files with same name in different directories it throws the error: `invalid Zip archive: Duplicate filename` Adding dir path to zip should prevent that while maintaining uniqueness in identifying files. Reference: https://discord.com/channels/1256822430505373696/1308114848403685406/1328180907554766910 --- qlty-cloud/src/export/coverage.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qlty-cloud/src/export/coverage.rs b/qlty-cloud/src/export/coverage.rs index f10bd72cc..c500d053c 100644 --- a/qlty-cloud/src/export/coverage.rs +++ b/qlty-cloud/src/export/coverage.rs @@ -21,8 +21,8 @@ fn compress_files(files: Vec, output_file: &Path) -> Result<()> { if path.is_file() { // Add the file to the archive - let file_name = path.file_name().unwrap().to_string_lossy(); - zip.start_file(file_name, options)?; + // Use path as filename in case multiple files with same name + zip.start_file(path.to_string_lossy(), options)?; // Write the file content to the archive let mut file = File::open(path)?;