summaryrefslogtreecommitdiff
path: root/sequencer.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 /sequencer.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 'sequencer.c')
-rw-r--r--sequencer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index 31e24f3..643744f 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3555,11 +3555,13 @@ static int error_failed_squash(struct repository *r,
static int do_exec(struct repository *r, const char *command_line)
{
- const char *child_argv[] = { command_line, NULL };
+ struct child_process cmd = CHILD_PROCESS_INIT;
int dirty, status;
fprintf(stderr, _("Executing: %s\n"), command_line);
- status = run_command_v_opt(child_argv, RUN_USING_SHELL);
+ cmd.use_shell = 1;
+ strvec_push(&cmd.args, command_line);
+ status = run_command(&cmd);
/* force re-reading of the cache */
if (discard_index(r->index) < 0 || repo_read_index(r) < 0)