Skip to content

Commit 00a3689

Browse files
committed
fix: path must be resolved after absolutize
1 parent 4a13154 commit 00a3689

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/ssh/scp.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,8 @@ mod test {
796796
assert!(client
797797
.create_dir(Path::new("mydir"), UnixPex::from(0o755))
798798
.is_ok());
799+
let p = PathBuf::from(format!("{}/mydir", client.pwd().unwrap().display()));
800+
assert!(client.exists(&p).unwrap());
799801
finalize_client(client);
800802
}
801803

src/utils/path.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ pub fn absolutize(wrkdir: &Path, target: &Path) -> PathBuf {
3636
true => target.to_path_buf(),
3737
false => {
3838
let mut p: PathBuf = wrkdir.to_path_buf();
39-
let fixed_path = resolve(target);
40-
p.push(fixed_path);
41-
p
39+
p.push(target);
40+
resolve(&p)
4241
}
4342
}
4443
}

0 commit comments

Comments
 (0)