Skip to content

Commit

Permalink
t5601/t7406(mingw): do run tests with symlink support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Jul 10, 2024
1 parent f9f68bb commit c94de86
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions t/t5601-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 9 additions & 0 deletions t/t7406-submodule-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit c94de86

Please sign in to comment.