summaryrefslogtreecommitdiff
path: root/prompt.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-12-15 09:39:47 -0800
committerJunio C Hamano <gitster@pobox.com>2021-12-15 09:39:47 -0800
commit832ec72c3e15820c3b728b3a56398655d7bb7cb3 (patch)
treee2139982bd0e26cf3434a3e4edbc3d03ec44ec10 /prompt.c
parent9c5bef3b358b12b9af5d54014f4efc62588f5df1 (diff)
parentc7c4bdeccf3e737e6e674cd9f0828922e629ab06 (diff)
Merge branch 'ab/run-command'
API clean-up. * ab/run-command: run-command API: remove "env" member, always use "env_array" difftool: use "env_array" to simplify memory management run-command API: remove "argv" member, always use "args" run-command API users: use strvec_push(), not argv construction run-command API users: use strvec_pushl(), not argv construction run-command tests: use strvec_pushv(), not argv assignment run-command API users: use strvec_pushv(), not argv assignment upload-archive: use regular "struct child_process" pattern worktree: stop being overly intimate with run_command() internals
Diffstat (limited to 'prompt.c')
-rw-r--r--prompt.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/prompt.c b/prompt.c
index 5ded21a017..50df17279d 100644
--- a/prompt.c
+++ b/prompt.c
@@ -8,15 +8,12 @@
static char *do_askpass(const char *cmd, const char *prompt)
{
struct child_process pass = CHILD_PROCESS_INIT;
- const char *args[3];
static struct strbuf buffer = STRBUF_INIT;
int err = 0;
- args[0] = cmd;
- args[1] = prompt;
- args[2] = NULL;
+ strvec_push(&pass.args, cmd);
+ strvec_push(&pass.args, prompt);
- pass.argv = args;
pass.out = -1;
if (start_command(&pass))