From e6fe102b49014551f955e72ca0af2b0435a26d40 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 16 Feb 2021 11:18:49 +0200 Subject: fix: in an incremental backup, update total file count if needed Previously, we were showing "N/M", where N is the number of files found in the current backup run, and M the number of files in the previous backup. I found this confusing if the new run finds more files than were in the previous run. Now we increment M if N goes beyond it. --- src/backup_progress.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backup_progress.rs b/src/backup_progress.rs index b5ecc26..c6d16d9 100644 --- a/src/backup_progress.rs +++ b/src/backup_progress.rs @@ -55,6 +55,9 @@ impl BackupProgress { pub fn found_live_file(&self, filename: &Path) { self.progress.inc(1); + if self.progress.length() < self.progress.position() { + self.progress.set_length(self.progress.position()); + } self.progress .set_message(&format!("{}", filename.display())); } -- cgit v1.2.1