check: improve error on damaged index

Always return the `repository contains errors` message if a repository
is damaged and must be repaired. Also provide specific instructions how
to repair the index.
This commit is contained in:
Michael Eischer 2024-06-30 11:42:23 +02:00
parent a03e00373c
commit fdc7349aa4

View file

@ -274,7 +274,9 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
for _, err := range errs {
printer.E("error: %v\n", err)
}
return errors.Fatal("LoadIndex returned errors")
printer.E("\nThe repository index is damaged and must be repaired. You must run `restic repair index' to correct this.\n\n")
return errors.Fatal("repository contains errors")
}
orphanedPacks := 0