You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: disambiguate archive entries when multiple inputs share the same basename
When compressing multiple directories that share the same basename
(e.g., /a/parent1/Scripts and /a/parent2/Scripts), ouch previously
stripped paths to just the basename using file_name(). This caused:
- Zip: 'Invalid zip archive - Duplicate filename: Scripts/'
- Tar: both directories merge into one, data loss on decompress
Fix: detect when input paths have duplicate basenames and, in that
case, compute the common ancestor directory of all inputs. Archive
entries are then stored relative to this common ancestor, including
enough parent path components to disambiguate (e.g., parent1/Scripts
vs parent2/Scripts).
When basenames don't collide, behavior is unchanged (backward compatible).
Applied consistently to all three archive builders: tar, zip, and 7z.
Fixes#978
0 commit comments