diff --git a/cmd/restic/cmd_prune.go b/cmd/restic/cmd_prune.go index c50b3413e..8e3c5b53d 100644 --- a/cmd/restic/cmd_prune.go +++ b/cmd/restic/cmd_prune.go @@ -179,6 +179,12 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error { } bar.Done() + 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") + } + Verbosef("found %d of %d data blobs still in use, removing %d blobs\n", len(usedBlobs), stats.blobs, stats.blobs-len(usedBlobs))