Repository navigation
extract: restore directory modification times from the archive - #412
jayhemnani9910 wants to merge 1 commit into
Conversation
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.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #412 +/- ##
==========================================
+ Coverage 96.84% 97.97% +1.12%
==========================================
Files 11 15 +4
Lines 1492 2020 +528
Branches 29 42 +13
==========================================
+ Hits 1445 1979 +534
+ Misses 46 40 -6
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:
|
Merging this PR will not alter performance1 warning
Comparing |
6c7fea0 to
0447c11
Compare
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.
Depends on #411 (directories are unpacked after their contents).
Extracted directories keep the time they were created, or the time the last file was written into them. tar-rs sets the mtime of files only. GNU tar restores directory mtimes too:
After a directory member is unpacked, its mtime is set from the header with
filetime.filetimewas already inCargo.lockthrough tar-rs and is now a direct dependency, because it can set times on directories on Windows too. Negative times are kept, as tar-rs does for files. If the time can't be set (for example on./in a directory owned by someone else), tar printsCannot utimeand exits 2 at the end, like GNU tar, instead of stopping.New test
test_extract_keeps_directory_mtimefails without the change.cargo test --workspace: 111 passed, clippy and fmt clean. Directory mtimes, including.from a./member and a negative time, match GNU tar 1.35. Limits: the PAXmtimerecord isn't used (tar-rs reads the header field only, for files too).