summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-10-09 05:00:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-10-09 05:00:59 (GMT)
commit424663d9c822454cc605c5bab22afdc8475de031 (patch)
tree820771503d1226a58f9254dfefe68c7ac52f9caf /t
parent678a9ca629403b533da19da6772691cd68b1040d (diff)
parent71f4960b9190eecbc0a053dcb94a93d21780ca3a (diff)
downloadgit-424663d9c822454cc605c5bab22afdc8475de031.zip
git-424663d9c822454cc605c5bab22afdc8475de031.tar.gz
git-424663d9c822454cc605c5bab22afdc8475de031.tar.bz2
Merge branch 'js/mingw-spawn-with-spaces-in-path'
Test fix. * js/mingw-spawn-with-spaces-in-path: t0061: fix test for argv[0] with spaces (MINGW only)
Diffstat (limited to 't')
-rwxr-xr-xt/t0061-run-command.sh21
1 files changed, 17 insertions, 4 deletions
diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
index 015fac8..17c9c0f 100755
--- a/t/t0061-run-command.sh
+++ b/t/t0061-run-command.sh
@@ -210,10 +210,23 @@ test_expect_success MINGW 'verify curlies are quoted properly' '
test_cmp expect actual
'
-test_expect_success MINGW 'can spawn with argv[0] containing spaces' '
- cp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" ./ &&
- test_must_fail "$PWD/test-fake-ssh$X" 2>err &&
- grep TRASH_DIRECTORY err
+test_expect_success MINGW 'can spawn .bat with argv[0] containing spaces' '
+ bat="$TRASH_DIRECTORY/bat with spaces in name.bat" &&
+
+ # Every .bat invocation will log its arguments to file "out"
+ rm -f out &&
+ echo "echo %* >>out" >"$bat" &&
+
+ # Ask git to invoke .bat; clone will fail due to fake SSH helper
+ test_must_fail env GIT_SSH="$bat" git clone myhost:src ssh-clone &&
+
+ # Spawning .bat can fail if there are two quoted cmd.exe arguments.
+ # .bat itself is first (due to spaces in name), so just one more is
+ # needed to verify. GIT_SSH will invoke .bat multiple times:
+ # 1) -G myhost
+ # 2) myhost "git-upload-pack src"
+ # First invocation will always succeed. Test the second one.
+ grep "git-upload-pack" out
'
test_done