Skip to content

Commit

Permalink
Allow raw coverage files with same name (#1424)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marschattha authored Jan 14, 2025
1 parent 008ae17 commit e6ba9f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qlty-cloud/src/export/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ fn compress_files(files: Vec<String>, 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)?;
Expand Down

0 comments on commit e6ba9f1

Please sign in to comment.