Merge branch 'as/diff-shortstat-ignore-binary'
[gitweb.git] / t / t4012-diff-binary.sh
index e6379f2d82401fb3c5309a050f285d6d3f788be8..6cebb3951bc7f4e9b772efed052c485d82d1a68d 100755 (executable)
@@ -119,4 +119,23 @@ test_expect_success 'diff --no-index with binary creation' '
        test_cmp expected actual
 '
 
+cat >expect <<EOF
+ binfile  |   Bin 0 -> 1026 bytes
+ textfile | 10000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+EOF
+
+test_expect_success 'diff --stat with binary files and big change count' '
+       echo X | dd of=binfile bs=1k seek=1 &&
+       git add binfile &&
+       i=0 &&
+       while test $i -lt 10000; do
+               echo $i &&
+               i=$(($i + 1))
+       done >textfile &&
+       git add textfile &&
+       git diff --cached --stat binfile textfile >output &&
+       grep " | " output >actual &&
+       test_cmp expect actual
+'
+
 test_done