restic: change Find to return ids

That way consumers no longer have to manually convert the returned name
to an id.
This commit is contained in:
Michael Eischer
2022-10-15 16:00:05 +02:00
parent 258b487d8f
commit 02634dce7a
6 changed files with 16 additions and 24 deletions
+1 -4
View File
@@ -436,10 +436,7 @@ func runDebugExamine(ctx context.Context, gopts GlobalOptions, args []string) er
for _, name := range args {
id, err := restic.ParseID(name)
if err != nil {
name, err = restic.Find(ctx, repo.Backend(), restic.PackFile, name)
if err == nil {
id, err = restic.ParseID(name)
}
id, err = restic.Find(ctx, repo.Backend(), restic.PackFile, name)
if err != nil {
Warnf("error: %v\n", err)
continue