aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2008-08-23 23:21:21 +0400
committerJunio C Hamano <gitster@pobox.com>2008-08-23 23:59:20 -0700
commit5e568f9e3027797842807213ce590140c9daf9ce (patch)
treefa21172efdcaa4720c73c814e21721323c9abe7b /t
parent913e0e99b6a6e63af6a062622a1f94bd78fd8052 (diff)
downloadgit-5e568f9e3027797842807213ce590140c9daf9ce.tar.gz
git-5e568f9e3027797842807213ce590140c9daf9ce.tar.xz
Respect core.autocrlf in combined diff
Fix git-diff to make it produce useful 3-way diffs for merge conflicts in repositories with autocrlf enabled. Otherwise it always reports that the whole file was changed, because it uses the contents from the working tree without necessary conversion. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4015-diff-whitespace.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index ec98509fd..b1cbd36d1 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -352,4 +352,20 @@ test_expect_success 'checkdiff allows new blank lines' '
git diff --check
'
+test_expect_success 'combined diff with autocrlf conversion' '
+
+ git reset --hard &&
+ echo >x hello &&
+ git commit -m "one side" x &&
+ git checkout HEAD^ &&
+ echo >x goodbye &&
+ git commit -m "the other side" x &&
+ git config core.autocrlf true &&
+ test_must_fail git merge master &&
+
+ git diff | sed -e "1,/^@@@/d" >actual &&
+ ! grep "^-" actual
+
+'
+
test_done