summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2022-10-30 11:55:06 (GMT)
committerTaylor Blau <me@ttaylorr.com>2022-10-30 18:04:51 (GMT)
commitddbb47fde9b6d8cd9f3728847a378f634318cfb1 (patch)
treeef093554b4ce4914edb7a0a0ace39187347bb344 /run-command.c
parentef249b398e26dd76f473ce83a35219c520f6fdbe (diff)
downloadgit-ddbb47fde9b6d8cd9f3728847a378f634318cfb1.zip
git-ddbb47fde9b6d8cd9f3728847a378f634318cfb1.tar.gz
git-ddbb47fde9b6d8cd9f3728847a378f634318cfb1.tar.bz2
replace and remove run_command_v_opt()
Replace the remaining calls of run_command_v_opt() with run_command() calls and explict struct child_process variables. This is more verbose, but not by much overall. The code becomes more flexible, e.g. it's easy to extend to conditionally add a new argument. Then remove the now unused function and its own flag names, simplifying the run-command API. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/run-command.c b/run-command.c
index 923bad3..23e100d 100644
--- a/run-command.c
+++ b/run-command.c
@@ -1004,21 +1004,6 @@ int run_command(struct child_process *cmd)
return finish_command(cmd);
}
-int run_command_v_opt(const char **argv, int opt)
-{
- struct child_process cmd = CHILD_PROCESS_INIT;
- strvec_pushv(&cmd.args, argv);
- cmd.no_stdin = opt & RUN_COMMAND_NO_STDIN ? 1 : 0;
- cmd.git_cmd = opt & RUN_GIT_CMD ? 1 : 0;
- cmd.stdout_to_stderr = opt & RUN_COMMAND_STDOUT_TO_STDERR ? 1 : 0;
- cmd.silent_exec_failure = opt & RUN_SILENT_EXEC_FAILURE ? 1 : 0;
- cmd.use_shell = opt & RUN_USING_SHELL ? 1 : 0;
- cmd.clean_on_exit = opt & RUN_CLEAN_ON_EXIT ? 1 : 0;
- cmd.wait_after_clean = opt & RUN_WAIT_AFTER_CLEAN ? 1 : 0;
- cmd.close_object_store = opt & RUN_CLOSE_OBJECT_STORE ? 1 : 0;
- return run_command(&cmd);
-}
-
#ifndef NO_PTHREADS
static pthread_t main_thread;
static int main_thread_set;