config: work around bug with includeif:onbranch and early config
[gitweb.git] / t / t0061-run-command.sh
index 96bf6d6a7d0145334666fcd15373bad6ac66fd67..015fac8b5d077165c7f9ac8090fd4e2ac12a7cb3 100755 (executable)
@@ -31,7 +31,15 @@ test_expect_success 'run_command can run a command' '
        test_must_be_empty err
 '
 
-test_expect_success 'run_command is restricted to PATH' '
+
+test_lazy_prereq RUNS_COMMANDS_FROM_PWD '
+       write_script runs-commands-from-pwd <<-\EOF &&
+       true
+       EOF
+       runs-commands-from-pwd >/dev/null 2>&1
+'
+
+test_expect_success !RUNS_COMMANDS_FROM_PWD 'run_command is restricted to PATH' '
        write_script should-not-run <<-\EOF &&
        echo yikes
        EOF
@@ -158,7 +166,8 @@ test_trace () {
        expect="$1"
        shift
        GIT_TRACE=1 test-tool run-command "$@" run-command true 2>&1 >/dev/null | \
-               sed -e 's/.* run_command: //' -e '/trace: .*/d' >actual &&
+               sed -e 's/.* run_command: //' -e '/trace: .*/d' \
+                       -e '/RUNTIME_PREFIX requested/d' >actual &&
        echo "$expect true" >expect &&
        test_cmp expect actual
 }
@@ -191,4 +200,20 @@ test_expect_success 'GIT_TRACE with environment variables' '
        )
 '
 
+test_expect_success MINGW 'verify curlies are quoted properly' '
+       : force the rev-parse through the MSYS2 Bash &&
+       git -c alias.r="!git rev-parse" r -- a{b}c >actual &&
+       cat >expect <<-\EOF &&
+       --
+       a{b}c
+       EOF
+       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_done