From ae0fcbba97a46dee1b5369ca5696e2737642410f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 10 Oct 2025 13:38:33 +0200 Subject: [PATCH] tests: ln -f: ensure existing link replaced Identified here: * tests/ln/misc.sh: Add the check. --- tests/ln/misc.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/ln/misc.sh b/tests/ln/misc.sh index bae731ef44..79ea5abe59 100755 --- a/tests/ln/misc.sh +++ b/tests/ln/misc.sh @@ -96,6 +96,14 @@ ln --no-dereference -fs "$af" $ld || fail=1 test -f $ld || fail=1 rm -rf $d $f $ld +# -f on a existing file should not generate an error +rm -rf $d $f +touch $f || framework_failure_ +mkdir $d || framework_failure_ +ln $f $d +ln -f $f $d || fail=1 +test -d $d || fail=1 + # Try to create a symlink with backup where the destination file exists # and the backup file name is a hard link to the destination file. touch a b || framework_failure_ -- 2.47.3