Avoid progress hang with empty files

[NO NEW TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
This commit is contained in:
Anders F Björklund
2023-07-17 19:10:38 +02:00
parent d8d600b1d9
commit d2862c7dd5

View File

@ -151,6 +151,9 @@ func progressBar(prefix string, size int64, onComplete string) (*mpb.Progress, *
decor.OnComplete(decor.CountersKibiByte("%.1f / %.1f"), ""),
),
)
if size == 0 {
bar.SetTotal(0, true)
}
return p, bar
}