11//! `copy` subcommand
22
33use crate :: {
4- commands:: { get_repository, open_repository} ,
4+ commands:: { get_repository, init :: init_password , open_repository} ,
55 config:: AllRepositoryOptions ,
66 helpers:: table_with_titles,
77 status_err, Application , RUSTIC_APP ,
@@ -69,6 +69,7 @@ impl CopyCmd {
6969 for target_opt in & config. copy . targets {
7070 let repo_dest = get_repository ( target_opt) ?;
7171
72+ info ! ( "copying to target {}..." , repo_dest. name) ;
7273 let repo_dest = if self . init && repo_dest. config_id ( ) ?. is_none ( ) {
7374 if config. global . dry_run {
7475 error ! (
@@ -79,13 +80,12 @@ impl CopyCmd {
7980 }
8081 let mut config_dest = repo. config ( ) . clone ( ) ;
8182 config_dest. id = Id :: random ( ) ;
82- let pass = repo_dest . password ( ) ? . unwrap ( ) ;
83+ let pass = init_password ( & repo_dest ) ? ;
8384 repo_dest. init_with_config ( & pass, & self . key_opts , config_dest) ?
8485 } else {
8586 open_repository ( target_opt) ?
8687 } ;
8788
88- info ! ( "copying to target {}..." , repo_dest. name) ;
8989 if poly != repo_dest. config ( ) . poly ( ) ? {
9090 bail ! ( "cannot copy to repository with different chunker parameter (re-chunking not implemented)!" ) ;
9191 }
0 commit comments