diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-03-17 11:13:16 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-03-17 14:42:14 -0700 |
| commit | 66865d12a0a15276fd525a461e0873bf82d4f246 (patch) | |
| tree | eb67caff7a3c52a90028da006282c0fc660b3b84 /t/t2400-worktree-add.sh | |
| parent | c36c62859ae59e5ff3cd2a620ab8c906793dc615 (diff) | |
| download | git-66865d12a0a15276fd525a461e0873bf82d4f246.tar.gz | |
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/t2400-worktree-add.sh')
| -rwxr-xr-x | t/t2400-worktree-add.sh | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh index 43139af08f..2f564d533d 100755 --- a/t/t2400-worktree-add.sh +++ b/t/t2400-worktree-add.sh @@ -559,10 +559,7 @@ test_expect_success 'git worktree --no-guess-remote option overrides config' ' ' post_checkout_hook () { - gitdir=${1:-.git} - test_when_finished "rm -f $gitdir/hooks/post-checkout" && - mkdir -p $gitdir/hooks && - write_script $gitdir/hooks/post-checkout <<-\EOF + test_hook -C "$1" post-checkout <<-\EOF { echo $* git rev-parse --git-dir --show-toplevel |
