{"thread":{"id":"65458","subject":"[PATCH] t1800: add &&-chains to test helper functions","startedAt":"2026-04-08T16:12:36Z","lastAt":"2026-04-08T17:16:17Z","messageCount":2,"participants":["Adrian Ratiu","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"541144","messageId":"20260408161148.2064854-1-adrian.ratiu@collabora.com","threadId":"65458","inReplyTo":null,"subject":"[PATCH] t1800: add &&-chains to test helper functions","fromName":"Adrian Ratiu","fromEmail":"adrian.ratiu@collabora.com","sentAt":"2026-04-08T16:11:48Z","receivedAt":"2026-04-08T16:12:36Z","isPatch":true,"body":"Add the missing &&'s so we properly propagate failures\nbetween commands in the hook helper functions.\n\nAlso add a missing mkdir -p arg (found by adding the &&).\n\nReported-by: SZEDER Gábor <szeder.dev@gmail.com>\nSigned-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>\n---\nThis is a small fix reported by Szeder, based on the master branch\nGitHub branch: https://github.com/10ne1/git/tree/refs/heads/dev/aratiu/tests-add-missing-and-chains\nClean CI run: https://github.com/10ne1/git/actions/runs/24137982261\n---\n t/t1800-hook.sh | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t1800-hook.sh b/t/t1800-hook.sh\nindex 96749fc06d..33decc66c0 100755\n--- a/t/t1800-hook.sh\n+++ b/t/t1800-hook.sh\n@@ -6,16 +6,16 @@ test_description='git-hook command and config-managed multihooks'\n . \"$TEST_DIRECTORY\"/lib-terminal.sh\n \n setup_hooks () {\n-\ttest_config hook.ghi.command \"/path/ghi\"\n-\ttest_config hook.ghi.event pre-commit --add\n-\ttest_config hook.ghi.event test-hook --add\n-\ttest_config_global hook.def.command \"/path/def\"\n+\ttest_config hook.ghi.command \"/path/ghi\" &&\n+\ttest_config hook.ghi.event pre-commit --add &&\n+\ttest_config hook.ghi.event test-hook --add &&\n+\ttest_config_global hook.def.command \"/path/def\" &&\n \ttest_config_global hook.def.event pre-commit --add\n }\n \n setup_hookdir () {\n-\tmkdir .git/hooks\n-\twrite_script .git/hooks/pre-commit <<-EOF\n+\tmkdir -p .git/hooks &&\n+\twrite_script .git/hooks/pre-commit <<-EOF &&\n \techo \\\"Legacy Hook\\\"\n \tEOF\n \ttest_when_finished rm -rf .git/hooks\n-- \n2.52.0\n\n"},{"id":"541153","messageId":"xmqqpl49z82o.fsf@gitster.g","threadId":"65458","inReplyTo":"20260408161148.2064854-1-adrian.ratiu@collabora.com","subject":"Re: [PATCH] t1800: add &&-chains to test helper functions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-04-08T17:16:15Z","receivedAt":"2026-04-08T17:16:17Z","isPatch":true,"body":"Adrian Ratiu <adrian.ratiu@collabora.com> writes:\n\n> Add the missing &&'s so we properly propagate failures\n> between commands in the hook helper functions.\n>\n> Also add a missing mkdir -p arg (found by adding the &&).\n>\n> Reported-by: SZEDER Gábor <szeder.dev@gmail.com>\n> Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>\n> ---\n> This is a small fix reported by Szeder, based on the master branch\n\nThanks, both of you.  Will directly apply on 'master'.\n\n> GitHub branch: https://github.com/10ne1/git/tree/refs/heads/dev/aratiu/tests-add-missing-and-chains\n> Clean CI run: https://github.com/10ne1/git/actions/runs/24137982261\n\n> ---\n>  t/t1800-hook.sh | 12 ++++++------\n>  1 file changed, 6 insertions(+), 6 deletions(-)\n>\n> diff --git a/t/t1800-hook.sh b/t/t1800-hook.sh\n> index 96749fc06d..33decc66c0 100755\n> --- a/t/t1800-hook.sh\n> +++ b/t/t1800-hook.sh\n> @@ -6,16 +6,16 @@ test_description='git-hook command and config-managed multihooks'\n>  . \"$TEST_DIRECTORY\"/lib-terminal.sh\n>  \n>  setup_hooks () {\n> -\ttest_config hook.ghi.command \"/path/ghi\"\n> -\ttest_config hook.ghi.event pre-commit --add\n> -\ttest_config hook.ghi.event test-hook --add\n> -\ttest_config_global hook.def.command \"/path/def\"\n> +\ttest_config hook.ghi.command \"/path/ghi\" &&\n> +\ttest_config hook.ghi.event pre-commit --add &&\n> +\ttest_config hook.ghi.event test-hook --add &&\n> +\ttest_config_global hook.def.command \"/path/def\" &&\n>  \ttest_config_global hook.def.event pre-commit --add\n>  }\n>  \n>  setup_hookdir () {\n> -\tmkdir .git/hooks\n> -\twrite_script .git/hooks/pre-commit <<-EOF\n> +\tmkdir -p .git/hooks &&\n> +\twrite_script .git/hooks/pre-commit <<-EOF &&\n>  \techo \\\"Legacy Hook\\\"\n>  \tEOF\n>  \ttest_when_finished rm -rf .git/hooks\n"}]}