Skip to content

Commit a477e74

Browse files
authored
fix(commands): Ask for password in backup and copy command if it is missing (#1061)
A user discovered that for some commands they are not being asked for a password, although they should. This implements a fix for the backup and copy command so they consistently call the same functionality that is being used for the other commands. Hence, asking for the password, if it's missing.
1 parent 6e73787 commit a477e74

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/commands/backup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::path::PathBuf;
44

55
use crate::{
6-
commands::{get_repository, init::init},
6+
commands::{get_repository, init::init, open_repository},
77
helpers::bytes_size_to_string,
88
status_err, Application, RUSTIC_APP,
99
};
@@ -144,7 +144,7 @@ impl BackupCmd {
144144
}
145145
init(repo, &self.key_opts, &self.config_opts)?
146146
} else {
147-
repo.open()?
147+
open_repository(&config.repository)?
148148
}
149149
.to_indexed_ids()?;
150150

src/commands/copy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl CopyCmd {
8282
let pass = repo_dest.password()?.unwrap();
8383
repo_dest.init_with_config(&pass, &self.key_opts, config_dest)?
8484
} else {
85-
repo_dest.open()?
85+
open_repository(target_opt)?
8686
};
8787

8888
info!("copying to target {}...", repo_dest.name);

0 commit comments

Comments
 (0)