Skip to content

Commit 95ba86a

Browse files
nasamuffingitster
authored andcommitted
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 <[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 306f445 commit 95ba86a

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

run-command.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,39 +1313,6 @@ int async_with_fork(void)
13131313
#endif
13141314
}
13151315

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-
13491316
struct io_pump {
13501317
/* initialized by caller */
13511318
int fd;

run-command.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,22 +220,6 @@ int finish_command_in_signal(struct child_process *);
220220
*/
221221
int run_command(struct child_process *);
222222

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-
239223
/*
240224
* Trigger an auto-gc
241225
*/

0 commit comments

Comments
 (0)