]> git.ipfire.org Git - thirdparty/git.git/commitdiff
commit-graph tests: fix error-hiding graph_git_two_modes() helper
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 14 Oct 2021 23:37:14 +0000 (01:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Oct 2021 16:21:30 +0000 (09:21 -0700)
The graph_git_two_modes() helper added in 177722b3442 (commit:
integrate commit graph with commit parsing, 2018-04-10) didn't
&&-chain its "git commit-graph" invocations, which as can be seen with
SANITIZE=leak will happily mark tests as passing if both of these
commands die, since test_cmp() will be comparing two empty files.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5318-commit-graph.sh

index af88f805aa275b6cd7a0ef4c50819a8538d7b0d1..579067299e508fe816fe6b86eaeb622795dab70c 100755 (executable)
@@ -51,8 +51,8 @@ test_expect_success 'create commits and repack' '
 '
 
 graph_git_two_modes() {
-       git -c core.commitGraph=true $1 >output
-       git -c core.commitGraph=false $1 >expect
+       git -c core.commitGraph=true $1 >output &&
+       git -c core.commitGraph=false $1 >expect &&
        test_cmp expect output
 }