Skip to content

Commit 2bf3501

Browse files
committed
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
2 parents 677f32c + 97669ee commit 2bf3501

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

t/t3032-merge-recursive-options.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test_description='merge-recursive options
1414
. ./test-lib.sh
1515

1616
test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b
17-
test_have_prereq MINGW && export GREP_OPTIONS=-U
17+
test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U
1818

1919
test_expect_success 'setup' '
2020
conflict_hunks () {

t/t5560-http-backend-noserver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ test_description='test git-http-backend-noserver'
55

66
HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
77

8-
test_have_prereq MINGW && export GREP_OPTIONS=-U
8+
test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U
99

1010
run_backend() {
1111
echo "$2" |

t/test-lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,13 +825,15 @@ case $(uname -s) in
825825
test_set_prereq MINGW
826826
test_set_prereq NOT_CYGWIN
827827
test_set_prereq SED_STRIPS_CR
828+
test_set_prereq GREP_STRIPS_CR
828829
;;
829830
*CYGWIN*)
830831
test_set_prereq POSIXPERM
831832
test_set_prereq EXECKEEPSPID
832833
test_set_prereq NOT_MINGW
833834
test_set_prereq CYGWIN
834835
test_set_prereq SED_STRIPS_CR
836+
test_set_prereq GREP_STRIPS_CR
835837
;;
836838
*)
837839
test_set_prereq POSIXPERM

0 commit comments

Comments
 (0)