From 4d715ac05cf5b800a98ce75bbc0cb3ea2dfe70ab Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Sat, 26 Oct 2013 21:17:15 +0200 Subject: Windows: a test_cmp that is agnostic to random LF <> CRLF conversions In a number of tests, output that was produced by a shell script is compared to expected output using test_cmp. Unfortunately, the MSYS bash-- when invoked via git, such as in hooks--converts LF to CRLF on output (as produced by echo and printf), which leads to many false positives. Implements a diff tool that undoes the converted CRLF. To avoid that sub-processes are spawned (which is very slow on Windows), the tool is implemented as a shell function. Diff is invoked as usual only when a difference is detected by the shell code. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/test-lib.sh | 1 + 1 file changed, 1 insertion(+) (limited to 't/test-lib.sh') diff --git a/t/test-lib.sh b/t/test-lib.sh index 0fa7dfde7b..77e487bd57 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -817,6 +817,7 @@ case $(uname -s) in test_set_prereq NOT_CYGWIN test_set_prereq SED_STRIPS_CR test_set_prereq GREP_STRIPS_CR + GIT_TEST_CMP=mingw_test_cmp ;; *CYGWIN*) test_set_prereq POSIXPERM -- cgit v1.3-5-g9baa