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. While at it, add the missing `SYMLINKS` prereq because this test _still_ would not pass on Windows before support for symbolic links is upstreamed from Git for Windows. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Dec 17, 2025 at 14:18 UTC eae7c16c3db2e746dd720c4e9ad7c1724d372b07
1 file changed +7 -2
t/t6423-merge-rename-directories.sh
+7 -2
@@ -5158,13 +5158,18 @@ test_setup_12m () {
5158 git switch B &&
5159 git rm dir/subdir/file &&
5160 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 &&
5167 git add . &&
5168 git commit -m "B"
5169 )
5170 }
5171
5167 -test_expect_success '12m: Change parent of renamed-dir to symlink on other side' '
5172 +test_expect_success SYMLINKS '12m: Change parent of renamed-dir to symlink on other side' '
5173 test_setup_12m &&
5174 (
5175 cd 12m &&