Skip to content

Commit

Permalink
Merge branch 'ml/avoid-using-grep-on-crlf-files'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Jul 25, 2013
2 parents 677f32c + 97669ee commit 2bf3501
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion t/t3032-merge-recursive-options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
2 changes: 1 addition & 1 deletion t/t5560-http-backend-noserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" |
Expand Down
2 changes: 2 additions & 0 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -825,13 +825,15 @@ 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
test_set_prereq EXECKEEPSPID
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
Expand Down

0 comments on commit 2bf3501

Please sign in to comment.