]> git.ipfire.org Git - thirdparty/git.git/commit
commit-graph tests: fix another graph_git_two_modes() helper
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 14 Oct 2021 23:37:15 +0000 (01:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Oct 2021 16:21:30 +0000 (09:21 -0700)
commita046aa38ca9e0b62dc847a00a1bd8efaa682ef31
treedf86b0e9b07ab4a7f4357822cd9218ffe0968ac2
parent3247919a758710692e316a13c209e13933936d51
commit-graph tests: fix another graph_git_two_modes() helper

In 135a7123755 (commit-graph: add --split option to builtin,
2019-06-18) this function was copy/pasted to the split commit-graph
tests, as in the preceding commit we need to fix this to use
&&-chaining, so it won't be hiding errors.

Unlike its sister function in "t5318-commit-graph.sh", which we got
lucky with, this one was hiding a real test failure. A tests added in
c523035cbd8 (commit-graph: allow cross-alternate chains, 2019-06-18)
has never worked as intended. Unlike most other graph_git_behavior
uses in this file it clones the repository into a sub-directory, so
we'll need to refer to "commits/6" as "origin/commits/6".

It's not easy to simply move the "graph_git_behavior" to the test
above it, since it itself spawns a "test_expect_success". Let's
instead add support to "graph_git_behavior()" and
"graph_git_two_modes()" to pass a "-C" argument to git.

We also need to add a "test -d fork" here, because otherwise we'll
fail on e.g.:

    GIT_SKIP_TESTS=t5324.13 ./t5324-split-commit-graph.sh

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