git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] commit-graph tests: fix error-hiding graph_git_two_modes() helper

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 15, 2021, 16:03 UTC
Message-ID
<xmqq1r4m9sxt.fsf@gitster.g>
In-Reply-To
<patch-1.3-f74cc32ceea-20211014T233343Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 5 quoted lines
> 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.

As the chains the four invocation of this helper with &&- correctly, this does make a difference. Nicely spotted.

Show 19 quoted lines
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  t/t5318-commit-graph.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
> index 295c5bd94d2..88fbe004a38 100755
> --- a/t/t5318-commit-graph.sh
> +++ b/t/t5318-commit-graph.sh
> @@ -70,8 +70,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
>  }
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 3 of 7 in “commit-graph: make "verify" work with replace refs”
  1. 0/3 commit-graph: make "verify" work with replace refsÆvar Arnfjörð Bjarmason, Oct 14, 2021
  2. 1/3 commit-graph tests: fix error-hiding graph_git_two_modes() helperÆvar Arnfjörð Bjarmason, Oct 14, 2021
  3. Junio C HamanoOct 15, 2021
  4. 2/3 commit-graph tests: fix another graph_git_two_modes() helperÆvar Arnfjörð Bjarmason, Oct 14, 2021
  5. Junio C HamanoOct 15, 2021
  6. 3/3 commit-graph: don't consider "replace" objects with "verify"Ævar Arnfjörð Bjarmason, Oct 14, 2021
  7. Junio C HamanoOct 15, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.