Skip to content

Commit a628cb7

Browse files
committed
t2400: pass through args in post_checkout_hook for --git-dir
Preparing for `safe.bareRepository` defaulting to `explicit` (see 8d1a744), change the `post_checkout_hook` helper from hard-coding `test_hook -C "$1"` to forwarding all arguments via `test_hook "$@"`, so callers can pass `--git-dir <dir>` for bare repos. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent fd3e6db commit a628cb7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

t/t2400-worktree-add.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ done
10681068
post_checkout_hook () {
10691069
test_when_finished "rm -rf .git/hooks" &&
10701070
mkdir .git/hooks &&
1071-
test_hook -C "$1" post-checkout <<-\EOF
1071+
test_hook "$@" post-checkout <<-\EOF
10721072
{
10731073
echo $*
10741074
git rev-parse --git-dir --show-toplevel
@@ -1124,7 +1124,7 @@ test_expect_success '"add" in bare repo invokes post-checkout hook' '
11241124
echo $(pwd)/bare/worktrees/goozy &&
11251125
echo $(pwd)/goozy
11261126
} >hook.expect &&
1127-
post_checkout_hook bare &&
1127+
post_checkout_hook --git-dir bare &&
11281128
git -C bare worktree add --detach ../goozy &&
11291129
test_cmp hook.expect goozy/hook.actual
11301130
'

0 commit comments

Comments
 (0)