t4013: test diff-tree's --stdin commit formatting
authorJeff King <peff@peff.net>
Mon, 28 Jul 2014 18:01:57 +0000 (14:01 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Jul 2014 18:31:32 +0000 (11:31 -0700)
Once upon a time, git-log was just "rev-list | diff-tree",
and we did not bother to test it separately. These days git-log
is implemented internally, but we want to make sure that the
rev-list to diff-tree pipeline continues to function. Let's
add a basic sanity test.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4013-diff-various.sh
index e77c09c37eede2f039610199ba8e3c45e94213d4..f7a9af893b453134140366a879ccb4d720ef7050 100755 (executable)
@@ -324,4 +324,14 @@ test_expect_success 'diff --cached -- file on unborn branch' '
        test_cmp "$TEST_DIRECTORY/t4013/diff.diff_--cached_--_file0" result
 '
 
+test_expect_success 'diff-tree --stdin with log formatting' '
+       cat >expect <<-\EOF &&
+       Side
+       Third
+       Second
+       EOF
+       git rev-list master | git diff-tree --stdin --format=%s -s >actual &&
+       test_cmp expect actual
+'
+
 test_done