]> git.scripts.mit.edu Git - git.git/commitdiff
test-lib.sh - define and use GREP_STRIPS_CR
authorMark Levedahl <mlevedahl@gmail.com>
Thu, 18 Jul 2013 21:44:57 +0000 (17:44 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Jul 2013 23:44:40 +0000 (16:44 -0700)
Define a common macro for grep needing -U to allow tests to not need
to inquire of specific platforms needing this option. Change
t3032 and t5560 to use this rather than testing explicitly for mingw.
This fixes these two tests on Cygwin.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3032-merge-recursive-options.sh
t/t5560-http-backend-noserver.sh
t/test-lib.sh

index 2b17311cb0870ea210d9b5cbe167363d13641d67..5fd7bbb65244bdf6470508b6bc79aef58e79e86d 100755 (executable)
@@ -14,7 +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_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U
 
 test_expect_success 'setup' '
        conflict_hunks () {
index ef98d95e00d7d25ee408b311339cf4f10c44a5ad..9be9ae3436c929921bc0a2cd2a458e4e4500c154 100755 (executable)
@@ -5,7 +5,7 @@ test_description='test git-http-backend-noserver'
 
 HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
 
-test_have_prereq MINGW && export GREP_OPTIONS=-U
+test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U
 
 run_backend() {
        echo "$2" |
index 657b0bd862b7473b66b2feb378b8985e455e5ac9..6d4d11b7afdffe09c59427a33f2d286146cc74fe 100644 (file)
@@ -668,6 +668,7 @@ case $(uname -s) in
        test_set_prereq MINGW
        test_set_prereq NOT_CYGWIN
        test_set_prereq SED_STRIPS_CR
+       test_set_prereq GREP_STRIPS_CR
        ;;
 *CYGWIN*)
        test_set_prereq POSIXPERM
@@ -675,6 +676,7 @@ case $(uname -s) in
        test_set_prereq NOT_MINGW
        test_set_prereq CYGWIN
        test_set_prereq SED_STRIPS_CR
+       test_set_prereq GREP_STRIPS_CR
        ;;
 *)
        test_set_prereq POSIXPERM