2 # Copyright (c) 2011, Google Inc.
4 test_description
='diff --stat-count'
6 TEST_PASSES_SANITIZE_LEAK
=true
9 test_expect_success
'setup' '
18 test_expect_success
'mode-only change show as a 0-line change' '
23 cat >expect <<-\EOF &&
27 4 files changed, 2 insertions(+)
29 git diff --stat --stat-count=2 HEAD >actual &&
30 test_cmp expect actual
33 test_expect_success
'binary changes do not count in lines' '
37 cat "$TEST_DIRECTORY"/test-binary-1.png >d &&
38 cat >expect <<-\EOF &&
42 3 files changed, 2 insertions(+)
44 git diff --stat --stat-count=2 >actual &&
45 test_cmp expect actual
48 test_expect_success
'exclude unmerged entries from total file count' '
52 git ls-files -s a >x &&
56 sed -e "s/ 0 a/ $stage d/" x || return 1
58 git update-index --index-info &&
60 cat >expect <<-\EOF &&
64 3 files changed, 3 insertions(+)
66 git diff --stat --stat-count=2 >actual &&
67 test_cmp expect actual