diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index 569fed523..0cda6da15 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -191,10 +191,12 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error { return err } - if len(usedBlobs) > stats.blobs { - return errors.Fatalf("number of used blobs is larger than number of available blobs!\n" + - "Please report this error (along with the output of the 'prune' run) at\n" + - "https://github.com/restic/restic/issues/new") + for h := range usedBlobs { + if _, ok := blobCount[h]; !ok { + return errors.Fatalf("At least one data blob seems to be missing, aborting prune to prevent further data loss!\n" + + "Please report this error (along with the output of the 'prune' run) at\n" + + "https://github.com/restic/restic/issues/new") + } } Verbosef("found %d of %d data blobs still in use, removing %d blobs\n",