aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Ratiu <adrian.ratiu@collabora.com>2026-04-08 19:11:48 +0300
committerJunio C Hamano <gitster@pobox.com>2026-04-08 10:15:47 -0700
commit373d43e0829d91c61f35f46f6715a23adda7b35d (patch)
tree0ddb01c924404bb612c37ed94725d955873b6164
parent2b39a27d40682c09ac1c031f099ee602061597cd (diff)
downloadgit-373d43e0829d91c61f35f46f6715a23adda7b35d.tar.xz
t1800: add &&-chains to test helper functions
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t1800-hook.sh12
1 files 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