restic: Change FindSnapshot functions to return the snapshot

This commit is contained in:
Michael Eischer committed 2022-10-15 13:34:04 +02:00
1 parent b50f48594d
commit a3113c6097
15 files changed
+103 -160

No files matched your search

+1 -6
View File
@@ -139,16 +139,11 @@ func runDump(ctx context.Context, opts DumpOptions, gopts GlobalOptions, args []
}
}
id, err := restic.FindFilteredSnapshot(ctx, repo.Backend(), repo, opts.Paths, opts.Tags, opts.Hosts, nil, snapshotIDString)
sn, err := restic.FindFilteredSnapshot(ctx, repo.Backend(), repo, opts.Paths, opts.Tags, opts.Hosts, nil, snapshotIDString)
if err != nil {
Exitf(1, "failed to find snapshot: %v", err)
}
sn, err := restic.LoadSnapshot(ctx, repo, id)
if err != nil {
Exitf(2, "loading snapshot %q failed: %v", snapshotIDString, err)
}
err = repo.LoadIndex(ctx)
if err != nil {
return err