Skip to content

Commit

Permalink
Merge branch 'js/mingw-spawn-with-spaces-in-path' into jch
Browse files Browse the repository at this point in the history
Test fix.

* js/mingw-spawn-with-spaces-in-path:
  t0061: fix test for argv[0] with spaces (MINGW only)
  • Loading branch information
gitster committed Oct 7, 2019
2 parents 1d1f746 + 71f4960 commit b6d1e92
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions t/t0061-run-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b6d1e92

Please sign in to comment.