From a31d066524e55351b385e34f9494f36e9f960a6c Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 14 Dec 2010 18:32:12 +0000 Subject: [PATCH 1/4] t6038-*.sh: Pass the -b (--binary) option to sed on cygwin The tests using the fuzz_conflict helper function (tests 5-6) fail on cygwin in the same way they used to on MinGW, prior to commit ca02ad3. The solution is also the same; passing the -b (--binary) option to sed, using the SED_OPTIONS variable. We introduce a new prerequisite SED_STRIPS_CR to use in the conditional initialisation of SED_OPTIONS, rather than MINGW. The new prerequisite is set in test-lib.sh for both MinGW and Cygwin. Signed-off-by: Ramsay Jones Acked-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t6038-merge-text-auto.sh | 2 +- t/test-lib.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/t/t6038-merge-text-auto.sh b/t/t6038-merge-text-auto.sh index 460bf741b5..d9c2d386dd 100755 --- a/t/t6038-merge-text-auto.sh +++ b/t/t6038-merge-text-auto.sh @@ -14,7 +14,7 @@ test_description='CRLF merge conflict across text=auto change . ./test-lib.sh -test_have_prereq MINGW && SED_OPTIONS=-b +test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b test_expect_success setup ' git config core.autocrlf false && diff --git a/t/test-lib.sh b/t/test-lib.sh index 48fa516004..9e74357b4f 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1057,6 +1057,14 @@ case $(uname -s) in # backslashes in pathspec are converted to '/' # exec does not inherit the PID test_set_prereq MINGW + test_set_prereq SED_STRIPS_CR + ;; +*CYGWIN*) + test_set_prereq POSIXPERM + test_set_prereq BSLASHPSPEC + test_set_prereq EXECKEEPSPID + test_set_prereq NOT_MINGW + test_set_prereq SED_STRIPS_CR ;; *) test_set_prereq POSIXPERM From 906a9a7d1d86b9002813a531ab62f436e798b66b Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 14 Dec 2010 18:34:29 +0000 Subject: [PATCH 2/4] t3032-*.sh: Pass the -b (--binary) option to sed on cygwin The test using the conflict_hunks helper function (test 9) fails on cygwin, since sed (by default) throws away the CR from CRLF line endings. This behaviour is undesirable, since the validation code expects the CRLF line-ending to be present. In order to fix the problem we pass the -b (--binary) option to sed, using the SED_OPTIONS variable. We use the SED_STRIPS_CR prerequisite in the conditional initialisation of SED_OPTIONS. Signed-off-by: Ramsay Jones Acked-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t3032-merge-recursive-options.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh index 2293797553..f70f6c4da4 100755 --- a/t/t3032-merge-recursive-options.sh +++ b/t/t3032-merge-recursive-options.sh @@ -13,9 +13,11 @@ test_description='merge-recursive options . ./test-lib.sh +test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b + test_expect_success 'setup' ' conflict_hunks () { - sed -n -e " + sed $SED_OPTIONS -n -e " /^<<< Date: Tue, 14 Dec 2010 18:35:48 +0000 Subject: [PATCH 3/4] t3032-*.sh: Do not strip CR from line-endings while grepping on MinGW By default grep reads in text mode and converts CRLF into LF line endings, which causes tests 4, 6 and 8 to fail. In a similar manner to commit a94114ad (Do not strip CR when grepping HTTP headers, 2010-09-12), we set (and export) the GREP_OPTIONS variable to -U so that grep will use binary mode. Signed-off-by: Ramsay Jones Acked-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t3032-merge-recursive-options.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh index f70f6c4da4..29e049af55 100755 --- a/t/t3032-merge-recursive-options.sh +++ b/t/t3032-merge-recursive-options.sh @@ -14,6 +14,7 @@ test_description='merge-recursive options . ./test-lib.sh test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b +test_have_prereq MINGW && export GREP_OPTIONS=-U test_expect_success 'setup' ' conflict_hunks () { From 5b5d53cbe5d67bd86543a4851014fde0837d1344 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 14 Dec 2010 18:37:43 +0000 Subject: [PATCH 4/4] t4135-*.sh: Skip the "backslash" tests on cygwin The BSLASHPSPEC tests (11-13) fail on cygwin, since you can't create files containing an backslash character in the name. In order to skip these tests, we simply stop (incorrectly) asserting the BSLASHPSPEC prerequisite in test-lib.sh. Signed-off-by: Ramsay Jones Acked-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/test-lib.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 9e74357b4f..aee7d20cf9 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1061,7 +1061,6 @@ case $(uname -s) in ;; *CYGWIN*) test_set_prereq POSIXPERM - test_set_prereq BSLASHPSPEC test_set_prereq EXECKEEPSPID test_set_prereq NOT_MINGW test_set_prereq SED_STRIPS_CR