diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-03-17 13:13:16 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-18 00:42:14 +0300 |
commit | 66865d12a0a15276fd525a461e0873bf82d4f246 (patch) | |
tree | eb67caff7a3c52a90028da006282c0fc660b3b84 /t/t5543-atomic-push.sh | |
parent | c36c62859ae59e5ff3cd2a620ab8c906793dc615 (diff) |
tests: extend "test_hook" for "rm" and "chmod -x", convert "$HOOK"
Extend the "test_hook" function to take options to disable and remove
hooks. Using the wrapper instead of getting the path and running
"chmod -x" or "rm" will make it easier to eventually emulate the same
behavior with config-based hooks.
Not all of these tests need that new mode, but since the rest are
either closely related or use the same "$HOOK" pattern let's convert
them too.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5543-atomic-push.sh')
-rwxr-xr-x | t/t5543-atomic-push.sh | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/t/t5543-atomic-push.sh b/t/t5543-atomic-push.sh index bfee461861..70431122a4 100755 --- a/t/t5543-atomic-push.sh +++ b/t/t5543-atomic-push.sh @@ -162,16 +162,10 @@ test_expect_success 'atomic push obeys update hook preventing a branch to be pus test_commit two && git push --mirror up ) && - ( - cd upstream && - HOOKDIR="$(git rev-parse --git-dir)/hooks" && - HOOK="$HOOKDIR/update" && - mkdir -p "$HOOKDIR" && - write_script "$HOOK" <<-\EOF - # only allow update to main from now on - test "$1" = "refs/heads/main" - EOF - ) && + test_hook -C upstream update <<-\EOF && + # only allow update to main from now on + test "$1" = "refs/heads/main" + EOF ( cd workbench && git checkout main && |