Repository navigation
extract: warn when leading slashes are removed from member names - #415
Conversation
Members with absolute names were extracted under the current directory without a word. Like GNU tar, extraction now says Removing leading `/' from member names, once for each different prefix.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Merging this PR will not alter performance1 warning
Comparing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
==========================================
+ Coverage 96.84% 98.26% +1.41%
==========================================
Files 11 15 +4
Lines 1492 2013 +521
Branches 29 40 +11
==========================================
+ Hits 1445 1978 +533
+ Misses 46 34 -12
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
| out.flush().map_err(TarError::Io)?; | ||
| writeln!( | ||
| io::stderr(), | ||
| "tar: Removing leading `{}' from member names", |
There was a problem hiding this comment.
same string as in create.rs, could be shared, no?
There was a problem hiding this comment.
Yes, done in fc50e46: warn_removed_prefix in operations/mod.rs writes the message, and create and extract both call it.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Thanks for your PR |
An archive with absolute member names is extracted under the current directory (tar-rs
unpack_indrops the leading/), but nothing says so. GNU tar warns, once for each different prefix:Extraction now prints the same warning, the way
createalready does for its input files. The files end up in the same place as before.New test
test_extract_warns_about_leading_slashes_once_per_prefix(fails on main).cargo test --workspacepasses (112),cargo fmt --checkandcargo clippy --all-targets -- -D warningsare clean. On the archive above, stderr and the extracted tree are identical to GNU tar 1.35.-tstill lists without the warning (GNU warns there too);list.rsis being changed by #277 and #384, so I left it.