Skip to content

fix(archive): honor PreserveSymlinks and reject duplicate entry names#351

Merged
lovehunter9 merged 1 commit into
mainfrom
archive_debug
Jun 16, 2026
Merged

fix(archive): honor PreserveSymlinks and reject duplicate entry names#351
lovehunter9 merged 1 commit into
mainfrom
archive_debug

Conversation

@lovehunter9

Copy link
Copy Markdown
Collaborator

Summary

  • When preserveSymlinks=false, dereference symlink sources before handing them to 7z (7z's -snl is a no-op for zip/tar in our build, so the flag alone couldn't honor "do not preserve").
  • Pass -snl through the compound-tar (tar.gz/tar.bz2/tar.xz) path, which previously ignored PreserveSymlinks entirely.
  • Reject sources that would collapse to the same archive entry name (e.g. a symlink dereferenced onto its target, or two same-named files) with a clear up-front error instead of a raw 7z "Duplicate filename" failure.

Test plan

  • Compress file + symlink-to-file with preserve on → archive keeps the symlink as a link.
  • Same sources with preserve off → clear error: both would be archived as the same name.
  • tar.gz / 7z / zip all behave consistently.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@lovehunter9 lovehunter9 merged commit 6e37a95 into main Jun 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant