aboutsummaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2013-10-26 21:17:15 +0200
committerJunio C Hamano <gitster@pobox.com>2013-10-28 09:00:36 -0700
commit4d715ac05cf5b800a98ce75bbc0cb3ea2dfe70ab (patch)
tree23275296e29eb6822cf13909881c699c5449d6f7 /t/test-lib.sh
parentce1a0473e8b5892c27526c0f340b6d440c6f0fff (diff)
downloadgit-4d715ac05cf5b800a98ce75bbc0cb3ea2dfe70ab.tar.gz
git-4d715ac05cf5b800a98ce75bbc0cb3ea2dfe70ab.tar.xz
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 <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 0fa7dfde7..77e487bd5 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