Merge pull request #3935 from miles170/master

Only display the message if there were locks to be removed
This commit is contained in:
Michael Eischer
2022-09-24 20:53:13 +02:00
committed by GitHub
4 changed files with 39 additions and 10 deletions
+4 -2
View File
@@ -46,11 +46,13 @@ func runUnlock(opts UnlockOptions, gopts GlobalOptions) error {
fn = restic.RemoveAllLocks
}
err = fn(gopts.ctx, repo)
processed, err := fn(gopts.ctx, repo)
if err != nil {
return err
}
Verbosef("successfully removed locks\n")
if processed > 0 {
Verbosef("successfully removed %d locks\n", processed)
}
return nil
}