Bugfix: restic find --pack <tree-pack> did not produce output for tree packs#5664
Merged
Merged
Conversation
wplapper
added a commit
to wplapper/restic
that referenced
this pull request
Jan 17, 2026
Added three more tests - TestFindOldestNewest() to find a file in the repository where the ModTime of the file is within the specified range of options `--oldest`, `--newest' - TestFindBlobID() which finds the the data blob with a given ID - TestFindPackID() which finds all (data) blobs in a given packfile Note: there should be more tests once PR restic#5664 has been applied, which will test option `--pack` and option `--show-pack-id`
2 tasks
cmd/restic/cmd_find.go: now produces output for both data-blob and tree-blob packfiles. In func packsToBlobs() the Type of the blob is now checked and inserts the blob either into f.blobIDs or into f.treeIDs.
cmd/restic/cmd_find.go: linter suggests switch b.Type instead if / else if
cmd/restic/cmd_find_integration_test.go: Added integration test for `restic find --pack <tree-packfile> using JSON output option. restic find - correct integration errors cmd/restic/cmd_find_integration_test.go: 1.) linter spelling correction: it wants 'JSON...' 2.) Windows path are special restic find - windows problems cmd/restic/cmd_find_integration_test.go: I can't be bothered to work out how to convert \\ to /, so I excluded the test for windows
b8fecb1 to
bff5790
Compare
MichaelEischer
requested changes
Feb 19, 2026
MichaelEischer
left a comment
Member
There was a problem hiding this comment.
LGTM except for a few nits, see below.
corrected spelling mistake try to get Windows test to work as well
sorry, forgot to gofmt!
shortened the the string to exclude the drive mapping
mistyped string 'backupPath'
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.
cmd/restic/cmd_find.go: now produces output for both data-blob and tree-blob packfiles.
In
func packsToBlobs()the blob type is now checked and the blob is either inserted intof.blobIDsorf.treeIDs.What does this PR change? What problem does it solve?
This PR fixes a bug in
restic find --pack.Was the change previously discussed in an issue or on the forum?
Yes, in #5280
Checklist
[ ] I have added documentation for relevant changes (in the manual).changelog/unreleased/that describes the changes for our users (see template).