summaryrefslogtreecommitdiff
path: root/t/t4015-diff-whitespace.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-18 18:16:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-18 18:16:57 (GMT)
commit5977744d045cacb809a3e3630dbbd28fe83976ae (patch)
tree276ab50231e80bf913148e421247a5a4ecf78653 /t/t4015-diff-whitespace.sh
parent98ad90fbab90a423ca835956d3121c60db2eb218 (diff)
parent296c6bb21a6980f6e5b42f0790d6365c1e3f696f (diff)
downloadgit-5977744d045cacb809a3e3630dbbd28fe83976ae.zip
git-5977744d045cacb809a3e3630dbbd28fe83976ae.tar.gz
git-5977744d045cacb809a3e3630dbbd28fe83976ae.tar.bz2
Merge branch 'cc/maint-diff-CC-binary'
* cc/maint-diff-CC-binary: diff: fix "git show -C -C" output when renaming a binary file Conflicts: diff.c
Diffstat (limited to 't/t4015-diff-whitespace.sh')
-rwxr-xr-xt/t4015-diff-whitespace.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh
index e92eab0..935d101 100755
--- a/t/t4015-diff-whitespace.sh
+++ b/t/t4015-diff-whitespace.sh
@@ -438,6 +438,43 @@ test_expect_success 'whitespace-only changes not reported' '
test_cmp expect actual
'
+cat <<EOF >expect
+diff --git a/x b/z
+similarity index NUM%
+rename from x
+rename to z
+index 380c32a..a97b785 100644
+EOF
+test_expect_success 'whitespace-only changes reported across renames' '
+ git reset --hard &&
+ for i in 1 2 3 4 5 6 7 8 9; do echo "$i$i$i$i$i$i"; done >x &&
+ git add x &&
+ git commit -m "base" &&
+ sed -e "5s/^/ /" x >z &&
+ git rm x &&
+ git add z &&
+ git diff -w -M --cached |
+ sed -e "/^similarity index /s/[0-9][0-9]*/NUM/" >actual &&
+ test_cmp expect actual
+'
+
+cat >expected <<\EOF
+diff --git a/empty b/void
+similarity index 100%
+rename from empty
+rename to void
+EOF
+
+test_expect_success 'rename empty' '
+ git reset --hard &&
+ >empty &&
+ git add empty &&
+ git commit -m empty &&
+ git mv empty void &&
+ git diff -w --cached -M >current &&
+ test_cmp expected current
+'
+
test_expect_success 'combined diff with autocrlf conversion' '
git reset --hard &&