mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
ln: don't show error when overwriting a link with -sfn (#7449)
* ln: fix #6350 * test(ln): test_symlink_no_deref_dir success has no stderr
This commit is contained in:
parent
94132060b6
commit
1baedc417b
2 changed files with 6 additions and 1 deletions
|
@ -301,6 +301,7 @@ fn link_files_in_dir(files: &[PathBuf], target_dir: &Path, settings: &Settings)
|
|||
show_error!("Could not update {}: {e}", target_dir.quote());
|
||||
};
|
||||
}
|
||||
#[cfg(windows)]
|
||||
if target_dir.is_dir() {
|
||||
// Not sure why but on Windows, the symlink can be
|
||||
// considered as a dir
|
||||
|
|
|
@ -549,7 +549,11 @@ fn test_symlink_no_deref_dir() {
|
|||
scene.ucmd().args(&["-sn", dir1, link]).fails();
|
||||
|
||||
// Try with the no-deref
|
||||
scene.ucmd().args(&["-sfn", dir1, link]).succeeds();
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&["-sfn", dir1, link])
|
||||
.succeeds()
|
||||
.no_stderr();
|
||||
assert!(at.dir_exists(dir1));
|
||||
assert!(at.dir_exists(dir2));
|
||||
assert!(at.is_symlink(link));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue