Skip to content

Commit 255a6f9

Browse files
me-andgitster
authored andcommitted
t1800: correct test to handle Cygwin
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 <[email protected]> Helped-by: Đoàn Trần Công Danh <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d42b38d commit 255a6f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t1800-hook.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ test_expect_success 'git hook run a hook with a bad shebang' '
157157
write_script bad-hooks/test-hook "/bad/path/no/spaces" </dev/null &&
158158
159159
# TODO: We should emit the same (or at least a more similar)
160-
# error on Windows and !Windows. See the OS-specific code in
161-
# start_command()
162-
if test_have_prereq !WINDOWS
160+
# error on MINGW (essentially Git for Windows) and all other
161+
# platforms.. See the OS-specific code in start_command()
162+
if test_have_prereq !MINGW
163163
then
164164
cat >expect <<-\EOF
165165
fatal: cannot run bad-hooks/test-hook: ...

0 commit comments

Comments
 (0)