diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-02-16 11:18:49 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-02-16 11:20:39 +0200 |
commit | e6fe102b49014551f955e72ca0af2b0435a26d40 (patch) | |
tree | 5e3f046c55ed041608e3ad0c446ba93bbe08cbe4 | |
parent | f8161b8551f982af61eb4385734adbef5642113e (diff) | |
download | obnam2-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.rs | 3 |
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())); } |