extract_item: do not delete an existing directory if possible
A pre-existing directory might be a Btrfs subvolume that was created by the user ahead of time when restoring several nested subvolumes from a single archive.
I'm also interested in this feature being backported to Borg 1.2. I have a patch that applies on top of 1.2-maint.
See: #4233
Please rebase onto current master to fix the mypy issue.
Codecov Report
Merging #7866 (aee25c3) into master (9108039) will decrease coverage by
0.22%. The diff coverage is100.00%.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
@@ Coverage Diff @@
## master #7866 +/- ##
==========================================
- Coverage 83.33% 83.12% -0.22%
==========================================
Files 66 66
Lines 11853 11826 -27
Branches 2149 1866 -283
==========================================
- Hits 9878 9830 -48
- Misses 1393 1407 +14
- Partials 582 589 +7
| Files | Coverage Δ | |
|---|---|---|
| src/borg/archive.py | 83.45% <100.00%> (-0.23%) |
:arrow_down: |
A small test with an existing fs dir and then extracting "over" that would be good.
@intelfx can you add tests?