summaryrefslogtreecommitdiff
path: root/t/t4020-diff-external.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-04-12 17:55:18 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-04-12 17:56:25 -0700
commit7d5a1806e8c2d9980938a05a56939272ad2ec338 (patch)
tree6a09da6a7a0d76a3bf1fc0f2d860349c6efe1de9 /t/t4020-diff-external.sh
parentt1301-shared-repo: fix forced modes test (diff)
parentGIT 1.6.3-rc0 (diff)
downloadtgif-7d5a1806e8c2d9980938a05a56939272ad2ec338.tar.xz
Mark t1301 permission test to depend on POSIXPERM
This prepares the topic for inclusion to master.
Diffstat (limited to 't/t4020-diff-external.sh')
-rwxr-xr-xt/t4020-diff-external.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index 281680d95a..0720001281 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -136,4 +136,28 @@ 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_expect_success 'diff --cached' '
+ git add file &&
+ git update-index --assume-unchanged file &&
+ echo second >file &&
+ git diff --cached >actual &&
+ test_cmp ../t4020/diff.NUL actual
+'
+
test_done