Skip to content

Commit 15ae669

Browse files
committed
t6423: introduce Windows-specific handling for symlinking to /dev/null
The device `/dev/null` does not exist on Windows, it's called `NUL` there. Calling `ln -s /dev/null my-symlink` in a symlink-enabled MSYS2 Bash will therefore literally link to a file or directory called `null` that is supposed to be in the current drive's top-level `dev` directory. Which typically does not exist. The test, however, really wants the created symbolic link to point to the NUL device. Let's instead use the `mklink` utility on Windows to perform that job, and keep using `ln -s /dev/null <target>` on non-Windows platforms. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 930828c commit 15ae669

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

t/t6423-merge-rename-directories.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5158,7 +5158,12 @@ test_setup_12m () {
51585158
git switch B &&
51595159
git rm dir/subdir/file &&
51605160
mkdir dir &&
5161-
ln -s /dev/null dir/subdir &&
5161+
if test_have_prereq MINGW
5162+
then
5163+
cmd //c 'mklink dir\subdir NUL'
5164+
else
5165+
ln -s /dev/null dir/subdir
5166+
fi &&
51625167
git add . &&
51635168
git commit -m "B"
51645169
)

0 commit comments

Comments
 (0)