Repository navigation
create: add --no-recursion - #402
Conversation
With --no-recursion, a directory named on the command line is added as a directory entry only, without its contents, like GNU tar. Closes uutils#188
Merging this PR will not alter performance
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #402 +/- ##
==========================================
+ Coverage 96.84% 97.97% +1.12%
==========================================
Files 11 15 +4
Lines 1492 1827 +335
Branches 29 38 +9
==========================================
+ Hits 1445 1790 +345
+ Misses 46 36 -10
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:
|
GNU Testsuite Comparison |
|
|
||
| // If it's a directory, recursively add all contents | ||
| if path.is_dir() { | ||
| if path.is_dir() && !recursive { |
There was a problem hiding this comment.
could be a single if path.is_dir() with if recursive inside, no?
would avoid calling is_dir twice
There was a problem hiding this comment.
Good point, done.
GNU Testsuite Comparison |
|
Thanks for your PR |
Closes #188
With
--no-recursion, a directory named on the command line is added as a directory entry only, without its contents, like GNU tar. The entry is nameddir1/, the same wayappend_dir_allnames the top directory, and-vprints only the directory.create_archivegets arecursiveflag; the existing callers (unit tests and benches) passtrue. Addedtest_create_no_recursion, which checks both the-voutput and the archive listing.I used an AI assistant to help draft parts of the code and tests; I reviewed the changes and ran the tests myself.