]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4205: assert %(describe) test coverage
authorRené Scharfe <l.s.r@web.de>
Sun, 28 Feb 2021 11:22:26 +0000 (12:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Mar 2021 17:42:17 +0000 (09:42 -0800)
Document that the test is covering both describable and
undescribable commits.

Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4205-log-pretty-formats.sh

index 7e367062121db049d2f3dac05c7c253993d1bd6b..3b098913ed21cf0d7a52e535abec71f66bda95e9 100755 (executable)
@@ -965,8 +965,17 @@ test_expect_success 'log --pretty=reference is colored appropriately' '
 test_expect_success '%(describe) vs git describe' '
        git log --format="%H" | while read hash
        do
-               echo "$hash $(git describe $hash)"
+               if desc=$(git describe $hash)
+               then
+                       : >expect-contains-good
+               else
+                       : >expect-contains-bad
+               fi &&
+               echo "$hash $desc"
        done >expect &&
+       test_path_exists expect-contains-good &&
+       test_path_exists expect-contains-bad &&
+
        git log --format="%H %(describe)" >actual 2>err &&
        test_cmp expect actual &&
        test_must_be_empty err