tarAppender.addTarFile: normalize archivePath to POSIX - #40
Merged
Conversation
The archivePath is used as the path in the Tar archive, which uses POSIX / Unix paths. Normalize the path as a defense in-depth (FileInfoHeader also normalizes), then use the normalized hdr.Name as source of truth to set Linkname. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
force-pushed
the
addTarFile_posix
branch
from
July 15, 2026 12:47
2a024b4 to
9e1498c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
==========================================
- Coverage 66.35% 65.30% -1.05%
==========================================
Files 42 42
Lines 2027 2032 +5
==========================================
- Hits 1345 1327 -18
- Misses 497 532 +35
+ Partials 185 173 -12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Normalizes archivePath to POSIX-style slashes before creating tar headers, ensuring paths stored inside the tar archive (and hardlink Linkname values) consistently use / regardless of host OS path separators.
Changes:
- Normalize
archivePathviafilepath.ToSlashat the start oftarAppender.addTarFile. - Use
hdr.Name(the canonicalized tar path) as the source of truth when recording hardlink targets inSeenFiles, so subsequent hardlinkLinknamevalues are also canonical.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vvoland
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The archivePath is used as the path in the Tar archive, which uses POSIX / Unix paths.
Normalize the path as a defense in-depth (FileInfoHeader also normalizes), then use the normalized hdr.Name as source of truth to set Linkname.