aboutsummaryrefslogtreecommitdiffstats
path: root/scalar.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2022-11-08 17:15:12 -0500
committerTaylor Blau <me@ttaylorr.com>2022-11-08 17:15:12 -0500
commitbe4ac3b197f8b4070bdad65dea4a03e1389410a6 (patch)
tree9fc342eb7297ce681781e3d2b2b64a0d44d6dcd4 /scalar.c
parentMerge branch 'rs/archive-filter-error-once' (diff)
parentreplace and remove run_command_v_opt() (diff)
downloadgit-be4ac3b197f8b4070bdad65dea4a03e1389410a6.tar.gz
git-be4ac3b197f8b4070bdad65dea4a03e1389410a6.zip
Merge branch 'rs/no-more-run-command-v'
Simplify the run-command API. * rs/no-more-run-command-v: replace and remove run_command_v_opt() replace and remove run_command_v_opt_cd_env_tr2() replace and remove run_command_v_opt_tr2() replace and remove run_command_v_opt_cd_env() use child_process members "args" and "env" directly use child_process member "args" instead of string array variable sequencer: simplify building argument list in do_exec() bisect--helper: factor out do_bisect_run() bisect: simplify building "checkout" argument list am: simplify building "show" argument list run-command: fix return value comment merge: remove always-the-same "verbose" arguments
Diffstat (limited to 'scalar.c')
-rw-r--r--scalar.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/scalar.c b/scalar.c
index 6de9c0ee52..03f9e480dd 100644
--- a/scalar.c
+++ b/scalar.c
@@ -69,21 +69,18 @@ static void setup_enlistment_directory(int argc, const char **argv,
static int run_git(const char *arg, ...)
{
- struct strvec argv = STRVEC_INIT;
+ struct child_process cmd = CHILD_PROCESS_INIT;
va_list args;
const char *p;
- int res;
va_start(args, arg);
- strvec_push(&argv, arg);
+ strvec_push(&cmd.args, arg);
while ((p = va_arg(args, const char *)))
- strvec_push(&argv, p);
+ strvec_push(&cmd.args, p);
va_end(args);
- res = run_command_v_opt(argv.v, RUN_GIT_CMD);
-
- strvec_clear(&argv);
- return res;
+ cmd.git_cmd = 1;
+ return run_command(&cmd);
}
struct scalar_config {