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

Re: [PATCH] t1800: add &&-chains to test helper functions

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2026, 17:16 UTC
Message-ID
<xmqqpl49z82o.fsf@gitster.g>
In-Reply-To
<20260408161148.2064854-1-adrian.ratiu@collabora.com>
Adrian Ratiu <adrian.ratiu@collabora.com> writes:
Show 9 quoted lines
> Add the missing &&'s so we properly propagate failures
> between commands in the hook helper functions.
>
> Also add a missing mkdir -p arg (found by adding the &&).
>
> Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
> ---
> This is a small fix reported by Szeder, based on the master branch
Thanks, both of you.  Will directly apply on 'master'.
> GitHub branch: https://github.com/10ne1/git/tree/refs/heads/dev/aratiu/tests-add-missing-and-chains
> Clean CI run: https://github.com/10ne1/git/actions/runs/24137982261
Show 31 quoted lines
> ---
>  t/t1800-hook.sh | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/t/t1800-hook.sh b/t/t1800-hook.sh
> index 96749fc06d..33decc66c0 100755
> --- a/t/t1800-hook.sh
> +++ b/t/t1800-hook.sh
> @@ -6,16 +6,16 @@ test_description='git-hook command and config-managed multihooks'
>  . "$TEST_DIRECTORY"/lib-terminal.sh
>  
>  setup_hooks () {
> -	test_config hook.ghi.command "/path/ghi"
> -	test_config hook.ghi.event pre-commit --add
> -	test_config hook.ghi.event test-hook --add
> -	test_config_global hook.def.command "/path/def"
> +	test_config hook.ghi.command "/path/ghi" &&
> +	test_config hook.ghi.event pre-commit --add &&
> +	test_config hook.ghi.event test-hook --add &&
> +	test_config_global hook.def.command "/path/def" &&
>  	test_config_global hook.def.event pre-commit --add
>  }
>  
>  setup_hookdir () {
> -	mkdir .git/hooks
> -	write_script .git/hooks/pre-commit <<-EOF
> +	mkdir -p .git/hooks &&
> +	write_script .git/hooks/pre-commit <<-EOF &&
>  	echo \"Legacy Hook\"
>  	EOF
>  	test_when_finished rm -rf .git/hooks
Previous: Adrian Ratiu
Message 2 of 2 in “t1800: add &&-chains to test helper functions”
  1. t1800: add &&-chains to test helper functionsAdrian Ratiu, Apr 8, 2026
  2. Junio C HamanoApr 8, 2026

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.