Skip to content

Commit 4c5c47d

Browse files
committed
fixup! mingw: allow git.exe to be used instead of the "Git wrapper"
The original test case obviously only worked in the x86_64 flavor of Git for Windows (and since I rarely test on i686, this was not caught). This completely breaks on Windows/ARM64: +++ GIT_DIR=/dev/null +++ git diff --no-index --ignore-cr-at-eol -- expect actual diff --git a/expect b/actual index e0dc09e..2301bbf 100644 --- a/expect +++ b/actual @@ -1,3 +1,3 @@ -MSYSTEM=CLANGARM64 +MSYSTEM=MINGW64 mingw64 usr error: last command exited with $?=1 not ok 221 - MSYSTEM/PATH is adjusted if necessary To fix that, let's rely on `MINGW_PREFIX` (falling back to constructing it from `MSYSTEM`, defaulting to `MINGW64` if _that_ is unset, too). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 7a18c63 commit 4c5c47d

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

t/t0060-path-utils.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -621,30 +621,34 @@ test_expect_success !VALGRIND,RUNTIME_PREFIX,CAN_EXEC_IN_PWD '%(prefix)/ works'
621621
'
622622

623623
test_expect_success MINGW,RUNTIME_PREFIX 'MSYSTEM/PATH is adjusted if necessary' '
624-
mkdir -p "$HOME"/bin pretend/mingw64/bin \
625-
pretend/mingw64/libexec/git-core pretend/usr/bin &&
626-
cp "$GIT_EXEC_PATH"/git.exe pretend/mingw64/bin/ &&
627-
cp "$GIT_EXEC_PATH"/git.exe pretend/mingw64/libexec/git-core/ &&
624+
if test -z "$MINGW_PREFIX"
625+
then
626+
MINGW_PREFIX="/$(echo "${MSYSTEM:-MINGW64}" | tr A-Z a-z)"
627+
fi &&
628+
mkdir -p "$HOME"/bin pretend"$MINGW_PREFIX"/bin \
629+
pretend"$MINGW_PREFIX"/libexec/git-core pretend/usr/bin &&
630+
cp "$GIT_EXEC_PATH"/git.exe pretend"$MINGW_PREFIX"/bin/ &&
631+
cp "$GIT_EXEC_PATH"/git.exe pretend"$MINGW_PREFIX"/libexec/git-core/ &&
628632
# copy the .dll files, if any (happens when building via CMake)
629633
case "$GIT_EXEC_PATH"/*.dll in
630634
*/"*.dll") ;; # no `.dll` files to be copied
631635
*)
632-
cp "$GIT_EXEC_PATH"/*.dll pretend/mingw64/bin/ &&
633-
cp "$GIT_EXEC_PATH"/*.dll pretend/mingw64/libexec/git-core/
636+
cp "$GIT_EXEC_PATH"/*.dll pretend"$MINGW_PREFIX"/bin/ &&
637+
cp "$GIT_EXEC_PATH"/*.dll pretend"$MINGW_PREFIX"/libexec/git-core/
634638
;;
635639
esac &&
636640
echo "env | grep MSYSTEM=" | write_script "$HOME"/bin/git-test-home &&
637-
echo "echo mingw64" | write_script pretend/mingw64/bin/git-test-bin &&
641+
echo "echo ${MINGW_PREFIX#/}" | write_script pretend"$MINGW_PREFIX"/bin/git-test-bin &&
638642
echo "echo usr" | write_script pretend/usr/bin/git-test-bin2 &&
639643
640644
(
641645
MSYSTEM= &&
642646
GIT_EXEC_PATH= &&
643-
pretend/mingw64/libexec/git-core/git.exe test-home >actual &&
644-
pretend/mingw64/libexec/git-core/git.exe test-bin >>actual &&
645-
pretend/mingw64/bin/git.exe test-bin2 >>actual
647+
pretend"$MINGW_PREFIX"/libexec/git-core/git.exe test-home >actual &&
648+
pretend"$MINGW_PREFIX"/libexec/git-core/git.exe test-bin >>actual &&
649+
pretend"$MINGW_PREFIX"/bin/git.exe test-bin2 >>actual
646650
) &&
647-
test_write_lines MSYSTEM=$MSYSTEM mingw64 usr >expect &&
651+
test_write_lines MSYSTEM=$MSYSTEM "${MINGW_PREFIX#/}" usr >expect &&
648652
test_cmp expect actual
649653
'
650654

0 commit comments

Comments
 (0)