From 1671a3fe2e6a454bab916182ea40d0e61aa5f72c Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 30 Jun 2024 10:57:12 +0200 Subject: [PATCH] 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. --- cmd/restic/cmd_check.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index 1a27ed6ea..2da877fad 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -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 {