Add ForAllSnapshots

This commit is contained in:
Alexander Weiss
2020-11-28 08:59:12 +01:00
parent 058b102db0
commit 5b9ee56335
3 changed files with 18 additions and 12 deletions

View File

@@ -55,8 +55,7 @@ func prettyPrintJSON(wr io.Writer, item interface{}) error {
}
func debugPrintSnapshots(ctx context.Context, repo *repository.Repository, wr io.Writer) error {
return repo.List(ctx, restic.SnapshotFile, func(id restic.ID, size int64) error {
snapshot, err := restic.LoadSnapshot(ctx, repo, id)
return restic.ForAllSnapshots(ctx, repo, nil, func(id restic.ID, snapshot *restic.Snapshot, err error) error {
if err != nil {
return err
}