recreate: also do the work if --timestamp is the only change requested - #10302
Merged
ThomasWaldmann merged 1 commit intoSep 2, 2026
Merged
Conversation
ArchiveRecreater.recreate() skipped the archive ("Nothing to do.") when
neither patterns/paths, nor rechunking, nor a new comment were given,
silently ignoring a requested --timestamp change.
Also fix the timestamp tests: they gave the archive name as a positional
argument, but recreate positionals are PATHs in borg2, so the matcher was
accidentally non-empty (hiding this bug) and the recreated archive did not
contain any items at all. Select the archive via -a and assert that the
items survive the recreate.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10302 +/- ##
==========================================
+ Coverage 87.65% 87.69% +0.03%
==========================================
Files 103 103
Lines 18702 18712 +10
Branches 2877 2880 +3
==========================================
+ Hits 16393 16409 +16
+ Misses 1609 1600 -9
- Partials 700 703 +3 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
borg recreate -a ARCHIVE --timestamp ...with no other change requested (no PATHs/patterns, no--chunker-params, no--comment) printedSkipped archive ...: Nothing to do.and silently did not apply the requested timestamp, contradicting the option's help text.The work-trigger gate in
ArchiveRecreater.recreate()only considered the matcher, rechunking and the comment — notself.timestamp, although the value is correctly plumbed all the way totarget.save(timestamp=...).Fix
Include
self.timestamp is Nonein the gate.Tests
test_recreate_with_given_timestampnow passes only--timestamp(previously it also passed--comment, which triggered the work and masked this bug) — it fails on master and passes with this fix.Both timestamp tests also gave the archive name as a positional argument, but recreate positionals are PATHs in borg2: this made the matcher accidentally non-empty (also masking the bug) and recreated the archive with zero items, unnoticed. They now select the archive via
-aand assert that the items survive the recreate.🤖 Generated with Claude Code