Skip to content

Commit

Permalink
Fixed scp transfer non returning DirectoryAlreadyExists
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Aug 23, 2021
1 parent f601154 commit fc38039
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/filetransfer/scp_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,9 @@ impl FileTransfer for ScpFileTransfer {
info!("Making directory {}", dir.display());
let p: PathBuf = self.wrkdir.clone();
// If directory already exists, return Err
if self.stat(dir.as_path()).is_ok() {
let mut dir_stat_path: PathBuf = dir.clone();
dir_stat_path.push("./");
if self.stat(dir_stat_path.as_path()).is_ok() {
error!("Directory {} already exists", dir.display());
return Err(FileTransferError::new(
FileTransferErrorType::DirectoryAlreadyExists,
Expand Down

0 comments on commit fc38039

Please sign in to comment.