Skip to content

Commit

Permalink
Patch t1800 so it works on Cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
me-and committed Sep 1, 2022
1 parent e4a7cd9 commit f3e0456
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git.cygport
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SRC_URI="https://git.kernel.org/pub/scm/git/git.git/snapshot/${PN}-v${PV}.tar.gz
build-requires.txt"
SRC_DIR="${PN}-v${PV}"

PATCH_URI='1.8.5.2-cygwin.patch'
PATCH_URI='1.8.5.2-cygwin.patch t1800-cygwin.patch'

BUILD_REQUIRES="$(tr '\n' ' ' <build-requires.txt)"

Expand Down
25 changes: 25 additions & 0 deletions t1800-cygwin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
commit c13f9d87a97b6077cdb2de94df4dd8029f9dc3a7
Author: Adam Dinwoodie <[email protected]>
Date: Thu Sep 1 16:03:46 2022 +0100

t1800: correct test to handle Cygwin

The OS-specific code in start_command affects Git for Windows but not Cygwin;
Cygwin behaves like general *nix systems for these purposes. As such, when
checking for the error from running a script with a bad shebang, only expect
the Windows-style behaviour if the prerequisite MINGW is set, rather than using
WINDOWS which is set for both Git for Windows and for Cygwin builds.

diff --git a/t/t1800-hook.sh b/t/t1800-hook.sh
index 64096adac7..fae8b2faf9 100755
--- a/t/t1800-hook.sh
+++ b/t/t1800-hook.sh
@@ -159,7 +159,7 @@ test_expect_success 'git hook run a hook with a bad shebang' '
# 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
+ if test_have_prereq !MINGW
then
cat >expect <<-\EOF
fatal: cannot run bad-hooks/test-hook: ...

0 comments on commit f3e0456

Please sign in to comment.