mirror of
https://github.com/restic/restic.git
synced 2026-11-05 14:59:21 +00:00
replace FindFilteredSnapshots() with (*data.SnapshotFilter).FindAll() (#21912)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
This commit is contained in:
1 parent
75de8b54e6
commit
62991338ea
9 files changed
+103
-77
No files matched your search
@@ -675,11 +675,15 @@ func runFind(ctx context.Context, opts FindOptions, gopts global.Options, args [
|
||||
}
|
||||
|
||||
var filteredSnapshots []*data.Snapshot
|
||||
for sn := range FindFilteredSnapshots(ctx, snapshotLister, repo, &opts.SnapshotFilter, opts.Snapshots, printer) {
|
||||
err = opts.SnapshotFilter.FindAll(ctx, snapshotLister, repo, opts.Snapshots, func(_ string, sn *data.Snapshot, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
filteredSnapshots = append(filteredSnapshots, sn)
|
||||
}
|
||||
if ctx.Err() != nil {
|
||||
return ctx.Err()
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sort.Slice(filteredSnapshots, func(i, j int) bool {
|
||||
|
||||
Reference in new issue
Block a user