mirror of
https://github.com/restic/restic.git
synced 2026-09-15 08:47:57 +00:00
copy/find/ls/recover/stats: Memorize snapshot listing before index
These commands filter the snapshots according to some criteria which essentially requires loading the index before filtering the snapshots. Thus create a copy of the snapshots list beforehand and use it later on.
This commit is contained in:
@@ -73,7 +73,7 @@ func prettyPrintJSON(wr io.Writer, item interface{}) error {
|
||||
}
|
||||
|
||||
func debugPrintSnapshots(ctx context.Context, repo *repository.Repository, wr io.Writer) error {
|
||||
return restic.ForAllSnapshots(ctx, repo, nil, func(id restic.ID, snapshot *restic.Snapshot, err error) error {
|
||||
return restic.ForAllSnapshots(ctx, repo.Backend(), repo, nil, func(id restic.ID, snapshot *restic.Snapshot, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user