run-command: remove old run_hook_{le,ve}() hook API
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 <emilyshaffer@google.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Emily Shaffer committed
Dec 22, 2021 at 04:59 UTC
95ba86a203213fb828de096dc0dba18ce94598f7
2 files changed
-49
run-command.c
-33
@@ -1313,39 +1313,6 @@ int async_with_fork(void)
1313
#endif
1314
}
1315
1316
-static int run_hook_ve(const char *const *env, const char *name, va_list args)
1317
-{
1318
- struct child_process hook = CHILD_PROCESS_INIT;
1319
- const char *p;
1320
-
1321
- p = find_hook(name);
1322
- if (!p)
1323
- return 0;
1324
-
1325
- strvec_push(&hook.args, p);
1326
- while ((p = va_arg(args, const char *)))
1327
- strvec_push(&hook.args, p);
1328
- if (env)
1329
- strvec_pushv(&hook.env_array, (const char **)env);
1330
- hook.no_stdin = 1;
1331
- hook.stdout_to_stderr = 1;
1332
- hook.trace2_hook_name = name;
1333
-
1334
- return run_command(&hook);
1335
-}
1336
-
1337
-int run_hook_le(const char *const *env, const char *name, ...)
1338
-{
1339
- va_list args;
1340
- int ret;
1341
-
1342
- va_start(args, name);
1343
- ret = run_hook_ve(env, name, args);
1344
- va_end(args);
1345
-
1346
- return ret;
1347
-}
1348
-
1316
struct io_pump {
1317
/* initialized by caller */
1318
int fd;
run-command.h
-16
@@ -220,22 +220,6 @@ int finish_command_in_signal(struct child_process *);
220
*/
221
int run_command(struct child_process *);
222
223
-/**
224
- * Run a hook.
225
- * The first argument is a pathname to an index file, or NULL
226
- * if the hook uses the default index file or no index is needed.
227
- * The second argument is the name of the hook.
228
- * The further arguments correspond to the hook arguments.
229
- * The last argument has to be NULL to terminate the arguments list.
230
- * If the hook does not exist or is not executable, the return
231
- * value will be zero.
232
- * If it is executable, the hook will be executed and the exit
233
- * status of the hook is returned.
234
- * On execution, .stdout_to_stderr and .no_stdin will be set.
235
- */
236
-LAST_ARG_MUST_BE_NULL
237
-int run_hook_le(const char *const *env, const char *name, ...);
238
-
223
/*
224
* Trigger an auto-gc
225
*/