ln: don't show error when overwriting a link with -sfn (#7449)
Some checks failed
GnuTests / Run GNU tests (push) Has been cancelled
Android / Test builds (push) Has been cancelled
CICD / Style/cargo-deny (push) Has been cancelled
CICD / Style/deps (push) Has been cancelled
CICD / Documentation/warnings (push) Has been cancelled
CICD / MinRustV (push) Has been cancelled
CICD / Dependencies (push) Has been cancelled
CICD / Code Coverage (push) Has been cancelled
CICD / Separate Builds (push) Has been cancelled
Code Quality / Style/format (push) Has been cancelled
Code Quality / Style/lint (push) Has been cancelled
Code Quality / Style/spelling (push) Has been cancelled
Code Quality / Style/toml (push) Has been cancelled
Code Quality / Style/Python (push) Has been cancelled
FreeBSD / Style and Lint (push) Has been cancelled
FreeBSD / Tests (push) Has been cancelled
CICD / Test all features separately (push) Has been cancelled
CICD / Build/Makefile (push) Has been cancelled
CICD / Build/stable (push) Has been cancelled
CICD / Build/nightly (push) Has been cancelled
CICD / Binary sizes (push) Has been cancelled
CICD / Build (push) Has been cancelled
CICD / Tests/BusyBox test suite (push) Has been cancelled
CICD / Tests/Toybox test suite (push) Has been cancelled
CICD / Build/SELinux (push) Has been cancelled

* ln: fix #6350

* test(ln): test_symlink_no_deref_dir success has no stderr
This commit is contained in:
Dorian Péron 2025-05-30 16:29:43 +02:00 committed by GitHub
parent 94132060b6
commit 1baedc417b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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));