diff options
| author | René Scharfe <l.s.r@web.de> | 2022-10-30 12:55:06 +0100 |
|---|---|---|
| committer | Taylor Blau <me@ttaylorr.com> | 2022-10-30 14:04:51 -0400 |
| commit | ddbb47fde9b6d8cd9f3728847a378f634318cfb1 (patch) | |
| tree | ef093554b4ce4914edb7a0a0ace39187347bb344 /builtin/fetch.c | |
| parent | ef249b398e26dd76f473ce83a35219c520f6fdbe (diff) | |
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 'builtin/fetch.c')
| -rw-r--r-- | builtin/fetch.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index a0fca93bb6..dd060dd65a 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1965,14 +1965,17 @@ static int fetch_multiple(struct string_list *list, int max_children) } else for (i = 0; i < list->nr; i++) { const char *name = list->items[i].string; - strvec_push(&argv, name); + struct child_process cmd = CHILD_PROCESS_INIT; + + strvec_pushv(&cmd.args, argv.v); + strvec_push(&cmd.args, name); if (verbosity >= 0) printf(_("Fetching %s\n"), name); - if (run_command_v_opt(argv.v, RUN_GIT_CMD)) { + cmd.git_cmd = 1; + if (run_command(&cmd)) { error(_("could not fetch %s"), name); result = 1; } - strvec_pop(&argv); } strvec_clear(&argv); |
