check: hide message about additional files if error in repo

The message says "[...] addition files were found [...]. This is
non-critical [...]". Unless users are highly experienced with restic,
it's hard to correctly interpret what "This" refers to. Thus, just hide
the message if there is a real problem.
This commit is contained in:
Michael Eischer 2024-06-30 10:57:12 +02:00
parent b1250eead9
commit 1671a3fe2e

View file

@ -296,7 +296,8 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
}
}
if orphanedPacks > 0 {
if orphanedPacks > 0 && !errorsFound {
// hide notice if repository is damaged
printer.P("%d additional files were found in the repo, which likely contain duplicate data.\nThis is non-critical, you can run `restic prune` to correct this.\n", orphanedPacks)
}
if ctx.Err() != nil {