summaryrefslogtreecommitdiff
path: root/credential.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-26 22:25:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-26 22:32:37 (GMT)
commitafbdba391eaf3c473eff8f12437ff510935b520f (patch)
tree06acc6a781e2c598873943ee407513a60ef7a3db /credential.c
parent47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc (diff)
downloadgit-afbdba391eaf3c473eff8f12437ff510935b520f.zip
git-afbdba391eaf3c473eff8f12437ff510935b520f.tar.gz
git-afbdba391eaf3c473eff8f12437ff510935b520f.tar.bz2
run_command: teach API users to use embedded 'args' more
The child_process structure has an embedded strvec for formulating the command line argument list these days, but code that predates the wide use of it prepared a separate char *argv[] array and manually set the child_process.argv pointer point at it. Teach these old-style code to lose the separate argv[] array. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'credential.c')
-rw-r--r--credential.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/credential.c b/credential.c
index d8d226b..efc29dc 100644
--- a/credential.c
+++ b/credential.c
@@ -274,11 +274,9 @@ static int run_credential_helper(struct credential *c,
int want_output)
{
struct child_process helper = CHILD_PROCESS_INIT;
- const char *argv[] = { NULL, NULL };
FILE *fp;
- argv[0] = cmd;
- helper.argv = argv;
+ strvec_push(&helper.args, cmd);
helper.use_shell = 1;
helper.in = -1;
if (want_output)