Browse Source

Merge branch 'ml/avoid-using-grep-on-crlf-files'

On systems that understand a CRLF as a line ending, tests in this
script that worked on files with CRLF line endings using "grep" to
extract matching lines may lose the CR at the end of lines that
match, causing the actual output not to match the expected output.

* ml/avoid-using-grep-on-crlf-files:
  test-lib.sh - define and use GREP_STRIPS_CR
maint
Junio C Hamano 12 years ago
parent
commit
2bf3501150
  1. 2
      t/t3032-merge-recursive-options.sh
  2. 2
      t/t5560-http-backend-noserver.sh
  3. 2
      t/test-lib.sh

2
t/t3032-merge-recursive-options.sh

@ -14,7 +14,7 @@ test_description='merge-recursive options @@ -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 () {

2
t/t5560-http-backend-noserver.sh

@ -5,7 +5,7 @@ test_description='test git-http-backend-noserver' @@ -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" |

2
t/test-lib.sh

@ -825,6 +825,7 @@ case $(uname -s) in @@ -825,6 +825,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
@ -832,6 +833,7 @@ case $(uname -s) in @@ -832,6 +833,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

Loading…
Cancel
Save