]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/receive-pack.c
Merge branch 'ab/config-based-hooks-2'
[thirdparty/git.git] / builtin / receive-pack.c
index 5c2732a0d0785d9cffbe8503890c997a67a84c65..c427ca09aafa69810fa7213cebb6375bb6a21b92 100644 (file)
@@ -1411,9 +1411,12 @@ static const char *push_to_checkout(unsigned char *hash,
                                    struct strvec *env,
                                    const char *work_tree)
 {
+       struct run_hooks_opt opt = RUN_HOOKS_OPT_INIT;
+
        strvec_pushf(env, "GIT_WORK_TREE=%s", absolute_path(work_tree));
-       if (run_hook_le(env->v, push_to_checkout_hook,
-                       hash_to_hex(hash), NULL))
+       strvec_pushv(&opt.env, env->v);
+       strvec_push(&opt.args, hash_to_hex(hash));
+       if (run_hooks_opt(push_to_checkout_hook, &opt))
                return "push-to-checkout hook declined";
        else
                return NULL;