Skip to content

Commit 426fd36

Browse files
peffgitster
authored andcommitted
t4006: resurrect commented-out tests
This set of tests was added by 4434e6b (tests: check --[short]stat output after chmod, 2012-05-01), and is primarily about the handling of binary versus text files. Later, 74faaa1 (Fix "git diff --stat" for interesting - but empty - file changes, 2012-10-17) changed the stat output so that the empty text file is mentioned rather than omitted. That commit just comments out these tests. There's no discussion in the commit message, but the original email[1] says: NOTE! This does break two of our tests, so we clearly did this on purpose, or at least tested for it. I just uncommented the subtests that this makes irrelevant, and changed the output of another one. I don't think they're irrelevant, though. We should be testing this "mode change only" case and making sure that it has the post-74faaa16f0 behavior. So this commit brings back those tests, with the current expected output. [1] https://public-inbox.org/git/CA+55aFz88GPJcfMSqiyY+u0Cdm48bEyrsTGxHVJbGsYsDg=Q5w@mail.gmail.com/ Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 0d0ac38 commit 426fd36

File tree

1 file changed

+32
-23
lines changed

1 file changed

+32
-23
lines changed

t/t4006-diff-mode.sh

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,37 @@ test_expect_success 'prepare binary file' '
3232
git commit -m binbin
3333
'
3434

35-
# test_expect_success '--stat output after text chmod' '
36-
# test_chmod -x rezrov &&
37-
# echo " 0 files changed" >expect &&
38-
# git diff HEAD --stat >actual &&
39-
# test_i18ncmp expect actual
40-
# '
41-
#
42-
# test_expect_success '--shortstat output after text chmod' '
43-
# git diff HEAD --shortstat >actual &&
44-
# test_i18ncmp expect actual
45-
# '
46-
#
47-
# test_expect_success '--stat output after binary chmod' '
48-
# test_chmod +x binbin &&
49-
# echo " 0 files changed" >expect &&
50-
# git diff HEAD --stat >actual &&
51-
# test_i18ncmp expect actual
52-
# '
53-
#
54-
# test_expect_success '--shortstat output after binary chmod' '
55-
# git diff HEAD --shortstat >actual &&
56-
# test_i18ncmp expect actual
57-
# '
35+
test_expect_success '--stat output after text chmod' '
36+
test_chmod -x rezrov &&
37+
cat >expect <<-\EOF &&
38+
rezrov | 0
39+
1 file changed, 0 insertions(+), 0 deletions(-)
40+
EOF
41+
git diff HEAD --stat >actual &&
42+
test_i18ncmp expect actual
43+
'
44+
45+
test_expect_success '--shortstat output after text chmod' '
46+
tail -n 1 <expect >expect.short &&
47+
git diff HEAD --shortstat >actual &&
48+
test_i18ncmp expect.short actual
49+
'
50+
51+
test_expect_success '--stat output after binary chmod' '
52+
test_chmod +x binbin &&
53+
cat >expect <<-EOF &&
54+
binbin | Bin
55+
rezrov | 0
56+
2 files changed, 0 insertions(+), 0 deletions(-)
57+
EOF
58+
git diff HEAD --stat >actual &&
59+
test_i18ncmp expect actual
60+
'
61+
62+
test_expect_success '--shortstat output after binary chmod' '
63+
tail -n 1 <expect >expect.short &&
64+
git diff HEAD --shortstat >actual &&
65+
test_i18ncmp expect.short actual
66+
'
5867

5968
test_done

0 commit comments

Comments
 (0)