t5601/t7406(mingw): do run tests with symlink support

A long time ago, we decided to run tests in Git for Windows' SDK with
the default `winsymlinks` mode: copying instead of linking. This is
still the default mode of MSYS2 to this day.

However, this is not how most users run Git for Windows: As the majority
of Git for Windows' users seem to be on Windows 10 and newer, likely
having enabled Developer Mode (which allows creating symbolic links
without administrator privileges), they will run with symlink support
enabled.

This is the reason why it is crucial to get the fixes for CVE-2024-? to
the users, and also why it is crucial to ensure that the test suite
exercises the related test cases. This commit ensures the latter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2024-04-09 16:50:56 +02:00
Родитель 805aebe9b7
Коммит 965b16798d
2 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -7,6 +7,16 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
# This test script contains test cases that need to create symbolic links. To
# make sure that these test cases are exercised in Git for Windows, where (for
# historical reasons) `ln -s` creates copies by default, let's specifically ask
# for `ln -s` to create symbolic links whenever possible.
if test_have_prereq MINGW
then
MSYS=${MSYS+$MSYS }winsymlinks:nativestrict
export MSYS
fi
X=
test_have_prereq !MINGW || X=.exe

Просмотреть файл

@ -14,6 +14,15 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
# This test script contains test cases that need to create symbolic links. To
# make sure that these test cases are exercised in Git for Windows, where (for
# historical reasons) `ln -s` creates copies by default, let's specifically ask
# for `ln -s` to create symbolic links whenever possible.
if test_have_prereq MINGW
then
MSYS=${MSYS+$MSYS }winsymlinks:nativestrict
export MSYS
fi
compare_head()
{