mirror of
https://github.com/git/git.git
synced 2026-06-30 19:58:12 +00:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
2b39a27d40
commit
373d43e082
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user