diff options
| author | Taylor Blau <me@ttaylorr.com> | 2022-11-08 17:15:12 -0500 |
|---|---|---|
| committer | Taylor Blau <me@ttaylorr.com> | 2022-11-08 17:15:12 -0500 |
| commit | be4ac3b197f8b4070bdad65dea4a03e1389410a6 (patch) | |
| tree | 9fc342eb7297ce681781e3d2b2b64a0d44d6dcd4 /add-interactive.c | |
| parent | Merge branch 'rs/archive-filter-error-once' (diff) | |
| parent | replace and remove run_command_v_opt() (diff) | |
| download | git-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 'add-interactive.c')
| -rw-r--r-- | add-interactive.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/add-interactive.c b/add-interactive.c index f071b2a1b4..ecc5ae1b24 100644 --- a/add-interactive.c +++ b/add-interactive.c @@ -997,18 +997,17 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps, count = list_and_choose(s, files, opts); opts->flags = 0; if (count > 0) { - struct strvec args = STRVEC_INIT; + struct child_process cmd = CHILD_PROCESS_INIT; - strvec_pushl(&args, "git", "diff", "-p", "--cached", + strvec_pushl(&cmd.args, "git", "diff", "-p", "--cached", oid_to_hex(!is_initial ? &oid : s->r->hash_algo->empty_tree), "--", NULL); for (i = 0; i < files->items.nr; i++) if (files->selected[i]) - strvec_push(&args, + strvec_push(&cmd.args, files->items.items[i].string); - res = run_command_v_opt(args.v, 0); - strvec_clear(&args); + res = run_command(&cmd); } putchar('\n'); |
