summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-02-16 11:18:49 +0200
committerLars Wirzenius <liw@liw.fi>2021-02-16 11:20:39 +0200
commite6fe102b49014551f955e72ca0af2b0435a26d40 (patch)
tree5e3f046c55ed041608e3ad0c446ba93bbe08cbe4
parentf8161b8551f982af61eb4385734adbef5642113e (diff)
downloadobnam2-e6fe102b49014551f955e72ca0af2b0435a26d40.tar.gz
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.
-rw-r--r--src/backup_progress.rs3
1 files changed, 3 insertions, 0 deletions
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()));
}