Make local branches behave like remote branches when --tracked
[gitweb.git] / t / t4020-diff-external.sh
index 281680d95afacb291d56d9d7f23efed1f3169e93..f8c99f1a985ba14a4361e9d1e75486d6806c8f77 100755 (executable)
@@ -136,4 +136,20 @@ test_expect_success 'GIT_EXTERNAL_DIFF with more than one changed files' '
        GIT_EXTERNAL_DIFF=echo git diff
 '
 
+echo "#!$SHELL_PATH" >fake-diff.sh
+cat >> fake-diff.sh <<\EOF
+cat $2 >> crlfed.txt
+EOF
+chmod a+x fake-diff.sh
+
+keep_only_cr () {
+       tr -dc '\015'
+}
+
+test_expect_success 'external diff with autocrlf = true' '
+       git config core.autocrlf true &&
+       GIT_EXTERNAL_DIFF=./fake-diff.sh git diff &&
+       test $(wc -l < crlfed.txt) = $(cat crlfed.txt | keep_only_cr | wc -c)
+'
+
 test_done