diff --git a/changelog/new.txt b/changelog/new.txt index cf290f1..a46dd52 100644 --- a/changelog/new.txt +++ b/changelog/new.txt @@ -5,6 +5,7 @@ Breaking changes: - Backing up multiple sources on the command line now results in one instead of several snapshots. Bugs fixed: +- `restore` command did not restore empty files. This is fixed. - `config` command did save the config file compressed which violates the repo design. This is fixed. New features: diff --git a/src/commands/restore.rs b/src/commands/restore.rs index 3feca9a..b4fb435 100644 --- a/src/commands/restore.rs +++ b/src/commands/restore.rs @@ -586,8 +586,8 @@ impl FileInfos { match (has_unmatched, open_file.is_some()) { (true, true) => Ok(AddFileResult::Modify(file_pos)), - (true, false) => Ok(AddFileResult::New(file_pos)), - (false, _) => Ok(AddFileResult::Verified), + (false, true) => Ok(AddFileResult::Verified), + (_, false) => Ok(AddFileResult::New(file_pos)), } }