Skip to content

extract --continue: skip complete dirs, count skipped files in --progress - #10506

Open
ThomasWaldmann wants to merge 1 commit into
borgbackup:masterfrom
ThomasWaldmann:extract-continue-dirs-progress
Open

ThomasWaldmann wants to merge 1 commit into
borgbackup:masterfrom
ThomasWaldmann:extract-continue-dirs-progress

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Two small fixes for borg extract --continue, refs #6857.

Directories

same_item() already treats an existing directory with the archived mode and mtime as complete (b85ad47), but do_extract never passed continue_extraction when restoring directory metadata. As a result, every directory got chown/chmod/ACLs/xattrs/times set again. The result was still correct, just slower. Both directory metadata passes now pass the flag. The first pass, which creates directories, is unchanged.

A directory whose content was changed by this run gets a new mtime, so it still gets its metadata restored.

test_extract_continue checked only inode and mtime, which come out the same either way. It now also checks that dir1's ctime is unchanged.

--progress

The progress total includes the files that --continue skips, but their size was never added to the progress counter. The percentage therefore stayed far below the real one, e.g. 0% while extracting the last 10% of the data. Skipped files now advance the progress by their size.

New test: test_extract_continue_progress.

Both new assertions fail without the fix and pass with it. The --continue docs in the extract epilog now mention directories.

🤖 Generated with Claude Code

…ress, refs borgbackup#6857

Directories: same_item() already considered an existing directory with the archived
mode and mtime as complete, but do_extract never passed continue_extraction when
restoring directory metadata, so all directories got their metadata restored again.

--progress: the total includes the files that --continue skips, but their size was
never added to the progress, so the percentage stayed far below the real one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.12%. Comparing base (7e3d305) to head (10bbecb).
⚠️ Report is 7 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10506   +/-   ##
=======================================
  Coverage   89.12%   89.12%           
=======================================
  Files         103      103           
  Lines       19783    19785    +2     
  Branches     3099     3100    +1     
=======================================
+ Hits        17631    17633    +2     
- Misses       1490     1492    +2     
+ Partials      662      660    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant