Skip to contentSkip to conversation

t3032-*.sh: Do not strip CR from line-endings while grepping on MinGW

PATCH In review Ramsay Jones 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 12/14 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.

---
 t/t3032-merge-recursive-options.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
t/t3032-merge-recursive-options.sh +1 -0
index f70f6c4..29e049a 100755
@@ -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 () {
Signature · 1 line
1.7.3
#1 lore raw
Quoted 7 lines · Ramsay Jones

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.

Adding these GNU specific options leaves a bad aftertaste in my mouth, but I'd pass them, as their use is limited to certain platforms with "prereq".

Thanks.