2 # Copyright (c) 2011, Google Inc.
4 test_description
='diff --stat-count'
7 test_expect_success
'setup' '
16 test_expect_success
'mode-only change show as a 0-line change' '
21 cat >expect <<-\EOF &&
25 4 files changed, 2 insertions(+)
27 git diff --stat --stat-count=2 HEAD >actual &&
28 test_cmp expect actual
31 test_expect_success
'binary changes do not count in lines' '
35 cat "$TEST_DIRECTORY"/test-binary-1.png >d &&
36 cat >expect <<-\EOF &&
40 3 files changed, 2 insertions(+)
42 git diff --stat --stat-count=2 >actual &&
43 test_cmp expect actual
46 test_expect_success
'exclude unmerged entries from total file count' '
50 git ls-files -s a >x &&
54 sed -e "s/ 0 a/ $stage d/" x
56 git update-index --index-info &&
58 cat >expect <<-\EOF &&
62 3 files changed, 3 insertions(+)
64 git diff --stat --stat-count=2 >actual &&
65 test_cmp expect actual