From dbb1c61365baabf4e74c6ef2eee4c4a520056c1d Mon Sep 17 00:00:00 2001 From: Emily Shaffer Date: Wed, 22 Dec 2021 04:59:41 +0100 Subject: read-cache: convert post-index-change to use hook.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the post-index-change hook away from run-command.h to and over to the new hook.h library. This removes the last direct user of "run_hook_ve()" outside of run-command.c ("run_hook_le()" still uses it). So we can make the function static now. A subsequent commit will remove this code entirely when "run_hook_le()" itself goes away. Signed-off-by: Emily Shaffer Signed-off-by: Ævar Arnfjörð Bjarmason Acked-by: Emily Shaffer Signed-off-by: Junio C Hamano --- run-command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'run-command.c') diff --git a/run-command.c b/run-command.c index 3ea2c2fc10..ea09de040a 100644 --- a/run-command.c +++ b/run-command.c @@ -1313,7 +1313,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; -- cgit v1.2.3 From 95ba86a203213fb828de096dc0dba18ce94598f7 Mon Sep 17 00:00:00 2001 From: Emily Shaffer Date: Wed, 22 Dec 2021 04:59:43 +0100 Subject: run-command: remove old run_hook_{le,ve}() hook API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new hook.h library has replaced all run-command.h hook-related functionality. So let's delete this dead code. Signed-off-by: Emily Shaffer Signed-off-by: Ævar Arnfjörð Bjarmason Acked-by: Emily Shaffer Signed-off-by: Junio C Hamano --- run-command.c | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'run-command.c') diff --git a/run-command.c b/run-command.c index ea09de040a..f32e4fe132 100644 --- a/run-command.c +++ b/run-command.c @@ -1313,39 +1313,6 @@ int async_with_fork(void) #endif } -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; - - p = find_hook(name); - if (!p) - return 0; - - strvec_push(&hook.args, p); - while ((p = va_arg(args, const char *))) - strvec_push(&hook.args, p); - if (env) - strvec_pushv(&hook.env_array, (const char **)env); - hook.no_stdin = 1; - hook.stdout_to_stderr = 1; - hook.trace2_hook_name = name; - - return run_command(&hook); -} - -int run_hook_le(const char *const *env, const char *name, ...) -{ - va_list args; - int ret; - - va_start(args, name); - ret = run_hook_ve(env, name, args); - va_end(args); - - return ret; -} - struct io_pump { /* initialized by caller */ int fd; -- cgit v1.2.3