]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1800: correct test to handle Cygwin
authorAdam Dinwoodie <adam@dinwoodie.org>
Thu, 15 Sep 2022 07:57:17 +0000 (08:57 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Sep 2022 17:29:51 +0000 (10:29 -0700)
On Cygwin, when failing to spawn a process using start_command, Git
outputs the same error as on Linux systems, rather than using the
GIT_WINDOWS_NATIVE-specific error output.  The WINDOWS test prerequisite
is set in both Cygwin and native Windows environments, which means it's
not appropriate to use to anticipate the error output from
start_command.  Instead, use the MINGW test prerequisite, which is only
set for Git in native Windows environments, and not for Cygwin.

Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
Helped-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1800-hook.sh

index 64096adac7e108cb605cce1d7f3a40a28b87c676..43fcb7c0bfc85e3d29455ec37cfbf437e00238a9 100755 (executable)
@@ -157,9 +157,9 @@ test_expect_success 'git hook run a hook with a bad shebang' '
        write_script bad-hooks/test-hook "/bad/path/no/spaces" </dev/null &&
 
        # TODO: We should emit the same (or at least a more similar)
-       # error on Windows and !Windows. See the OS-specific code in
-       # start_command()
-       if test_have_prereq !WINDOWS
+       # error on MINGW (essentially Git for Windows) and all other
+       # platforms.. See the OS-specific code in start_command()
+       if test_have_prereq !MINGW
        then
                cat >expect <<-\EOF
                fatal: cannot run bad-hooks/test-hook: ...