Skip to content

Replace Repository.SetIndex with internal helper#5532

Merged
MichaelEischer merged 6 commits into
restic:masterfrom
MichaelEischer:checker-cleanup
Oct 3, 2025
Merged

Replace Repository.SetIndex with internal helper#5532
MichaelEischer merged 6 commits into
restic:masterfrom
MichaelEischer:checker-cleanup

Conversation

@MichaelEischer

Copy link
Copy Markdown
Member

What does this PR change? What problem does it solve?

Repository.SetIndex is only used by the Checker code and RepairIndex. To allow converting SetIndex into a repository internal API, first split the checker into two parts: one that checks packs+index and another that checks the snapshot, tree and blob structure. Then SetIndex is replaced by loadIndexWithCallback which allows ignoring index load errors and inspecting the loaded indexes.

Was the change previously discussed in an issue or on the forum?

No.

Checklist

  • I have added tests for all code changes. No new tests. Keeping the tests in the checker package, but moving a lot of code to the repository package isn't ideal, but I didn't find a good line along which to split the code.
  • [ ] I have added documentation for relevant changes (in the manual).
  • [ ] There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I'm done! This pull request is ready for review.

@MichaelEischer MichaelEischer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@MichaelEischer MichaelEischer merged commit 264cd67 into restic:master Oct 3, 2025
22 of 24 checks passed
@MichaelEischer MichaelEischer deleted the checker-cleanup branch October 3, 2025 18:08
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