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 19:04:51 +0100 |
commit | ddbb47fde9b6d8cd9f3728847a378f634318cfb1 (patch) | |
tree | ef093554b4ce4914edb7a0a0ace39187347bb344 /builtin/difftool.c | |
parent | replace and remove run_command_v_opt_cd_env_tr2() (diff) | |
download | git-ddbb47fde9b6d8cd9f3728847a378f634318cfb1.tar.xz git-ddbb47fde9b6d8cd9f3728847a378f634318cfb1.zip |
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/difftool.c')
-rw-r--r-- | builtin/difftool.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/difftool.c b/builtin/difftool.c index 22bcc3444b..d7f08c8a7f 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -44,8 +44,11 @@ static int difftool_config(const char *var, const char *value, void *cb) static int print_tool_help(void) { - const char *argv[] = { "mergetool", "--tool-help=diff", NULL }; - return run_command_v_opt(argv, RUN_GIT_CMD); + struct child_process cmd = CHILD_PROCESS_INIT; + + cmd.git_cmd = 1; + strvec_pushl(&cmd.args, "mergetool", "--tool-help=diff", NULL); + return run_command(&cmd); } static int parse_index_info(char *p, int *mode1, int *mode2, |