Skip to content

Commit 306f445

Browse files
nasamuffingitster
authored andcommitted
receive-pack: convert push-to-checkout hook to hook.h
Move the push-to-checkout hook away from run-command.h to and over to the new hook.h library. This removes the last direct user of run_hook_le(), so we could remove that function now, but let's leave that to a follow-up cleanup commit. Signed-off-by: Emily Shaffer <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Acked-by: Emily Shaffer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dbb1c61 commit 306f445

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

builtin/receive-pack.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,9 +1424,12 @@ static const char *push_to_checkout(unsigned char *hash,
14241424
struct strvec *env,
14251425
const char *work_tree)
14261426
{
1427+
struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT;
1428+
14271429
strvec_pushf(env, "GIT_WORK_TREE=%s", absolute_path(work_tree));
1428-
if (run_hook_le(env->v, push_to_checkout_hook,
1429-
hash_to_hex(hash), NULL))
1430+
strvec_pushv(&opt.env, env->v);
1431+
strvec_push(&opt.args, hash_to_hex(hash));
1432+
if (run_hooks_opt(push_to_checkout_hook, &opt))
14301433
return "push-to-checkout hook declined";
14311434
else
14321435
return NULL;

0 commit comments

Comments
 (0)