mirror of
https://github.com/restic/restic.git
synced 2026-11-03 14:05:33 +00:00
restic: Change FindSnapshot functions to return the snapshot
This commit is contained in:
1 parent
b50f48594d
commit
a3113c6097
15 files changed
+103
-160
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user