@@ -3063,6 +3063,7 @@ static int do_write_locked_index(struct index_state *istate, struct lock_file *l
{
int ret;
int was_full = !istate->sparse_index;
+ struct run_hooks_opt hook_opt = RUN_HOOKS_OPT_INIT;
ret = convert_to_sparse(istate);
@@ -3091,9 +3092,13 @@ static int do_write_locked_index(struct index_state *istate, struct lock_file *l
else
ret = close_lock_file_gently(lock);
- run_hook_le(NULL, "post-index-change",
- istate->updated_workdir ? "1" : "0",
- istate->updated_skipworktree ? "1" : "0", NULL);
+ strvec_pushl(&hook_opt.args,
+ istate->updated_workdir ? "1" : "0",
+ istate->updated_skipworktree ? "1" : "0",
+ NULL);
+ run_hooks("post-index-change", &hook_opt);
+ run_hooks_opt_clear(&hook_opt);
+
istate->updated_workdir = 0;
istate->updated_skipworktree = 0;
@@ -1321,7 +1321,7 @@ int async_with_fork(void)
#endif
}
-int run_hook_ve(const char *const *env, const char *name, va_list args)
+static int run_hook_ve(const char *const *env, const char *name, va_list args)
{
struct child_process hook = CHILD_PROCESS_INIT;
const char *p;
@@ -216,7 +216,6 @@ int run_command(struct child_process *);
*/
LAST_ARG_MUST_BE_NULL
int run_hook_le(const char *const *env, const char *name, ...);
-int run_hook_ve(const char *const *env, const char *name, va_list args);
/*
* Trigger an auto-gc