Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-27 00:37:39 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-27 18:32:16 +0300
commitc0e190c168becfd7d6c27cd868542295bd474742 (patch)
tree729a0334efd3b0ff76e2883606ffead7fc39b09a
parent7cff3b67aca11f757fb36ac58a89ae54bcb5b19e (diff)
credential-cache: use child_process.args
As child_process structure has an embedded strvec args for formulating the command line, let's use it instead of using an out-of-line argv[] whose length needs to be maintained correctly. Also, when spawning a git subcommand, omit it from the command list and instead use the .git_cmd bit in the child_process structure. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--credential-cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/credential-cache.c b/credential-cache.c
index 1cccc3a0b9..04df61cf02 100644
--- a/credential-cache.c
+++ b/credential-cache.c
@@ -39,13 +39,13 @@ static int send_request(const char *socket, const struct strbuf *out)
static void spawn_daemon(const char *socket)
{
struct child_process daemon = CHILD_PROCESS_INIT;
- const char *argv[] = { NULL, NULL, NULL };
char buf[128];
int r;
- argv[0] = "git-credential-cache--daemon";
- argv[1] = socket;
- daemon.argv = argv;
+ strvec_pushl(&daemon.args,
+ "credential-cache--daemon", socket,
+ NULL);
+ daemon.git_cmd = 1;
daemon.no_stdin = 1;
daemon.out = -1;