restic: Change FindSnapshot functions to return the snapshot

This commit is contained in:
Michael Eischer 2022-10-03 14:48:14 +02:00
parent b50f48594d
commit a3113c6097
15 changed files with 103 additions and 160 deletions

View file

@ -26,7 +26,11 @@ func TestSnapshot(t testing.TB, repo restic.Repository, path string, parent *res
Tags: []string{"test"},
}
if parent != nil {
opts.ParentSnapshot = *parent
sn, err := restic.LoadSnapshot(context.TODO(), arch.Repo, *parent)
if err != nil {
t.Fatal(err)
}
opts.ParentSnapshot = sn
}
sn, _, err := arch.Snapshot(context.TODO(), []string{path}, opts)
if err != nil {