2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 19:08:55 +00:00

check: Partially fix garbled output

When reporting an error for a tree, the output message can overlap with
the progress bar output, e.g. `error for tree e91ef6fb:napshots`.

The fix only applies for this specific message and does not work on
Windows.
This commit is contained in:
Michael Eischer 2022-12-28 17:47:27 +01:00
parent aea96b7d86
commit 8430399fce

View File

@ -295,7 +295,11 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
for err := range errChan { for err := range errChan {
errorsFound = true errorsFound = true
if e, ok := err.(*checker.TreeError); ok { if e, ok := err.(*checker.TreeError); ok {
Warnf("error for tree %v:\n", e.ID.Str()) var clean string
if stdoutCanUpdateStatus() {
clean = clearLine(0)
}
Warnf(clean+"error for tree %v:\n", e.ID.Str())
for _, treeErr := range e.Errors { for _, treeErr := range e.Errors {
Warnf(" %v\n", treeErr) Warnf(" %v\n", treeErr)
} }