Skip to content

Commit 965b167

Browse files
committed
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 <[email protected]>
1 parent 805aebe commit 965b167

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

t/t5601-clone.sh

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

88
. ./test-lib.sh
99

10+
# This test script contains test cases that need to create symbolic links. To
11+
# make sure that these test cases are exercised in Git for Windows, where (for
12+
# historical reasons) `ln -s` creates copies by default, let's specifically ask
13+
# for `ln -s` to create symbolic links whenever possible.
14+
if test_have_prereq MINGW
15+
then
16+
MSYS=${MSYS+$MSYS }winsymlinks:nativestrict
17+
export MSYS
18+
fi
19+
1020
X=
1121
test_have_prereq !MINGW || X=.exe
1222

t/t7406-submodule-update.sh

+9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1414

1515
. ./test-lib.sh
1616

17+
# This test script contains test cases that need to create symbolic links. To
18+
# make sure that these test cases are exercised in Git for Windows, where (for
19+
# historical reasons) `ln -s` creates copies by default, let's specifically ask
20+
# for `ln -s` to create symbolic links whenever possible.
21+
if test_have_prereq MINGW
22+
then
23+
MSYS=${MSYS+$MSYS }winsymlinks:nativestrict
24+
export MSYS
25+
fi
1726

1827
compare_head()
1928
{

0 commit comments

Comments
 (0)