summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-01-05 21:28:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-05 21:28:10 (GMT)
commit0956eaa621c98453cda9c9fd55d35d97ddfd3ac6 (patch)
tree978f826e61cf046af6cd57b62a5ef56947e89615 /http.c
parenta778ba1c71eca2e7f9978bd529efa3f2d393710d (diff)
parenta923e05944271e2aa887721a1d2f24bb418eeca7 (diff)
downloadgit-0956eaa621c98453cda9c9fd55d35d97ddfd3ac6.zip
git-0956eaa621c98453cda9c9fd55d35d97ddfd3ac6.tar.gz
git-0956eaa621c98453cda9c9fd55d35d97ddfd3ac6.tar.bz2
Merge branch 'rs/use-argv-array-in-child-process'
Code cleanup. * rs/use-argv-array-in-child-process: send-pack: use internal argv_array of struct child_process http: use internal argv_array of struct child_process
Diffstat (limited to 'http.c')
-rw-r--r--http.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/http.c b/http.c
index 32d3326..5977712 100644
--- a/http.c
+++ b/http.c
@@ -2030,7 +2030,6 @@ int finish_http_pack_request(struct http_pack_request *preq)
char *tmp_idx;
size_t len;
struct child_process ip = CHILD_PROCESS_INIT;
- const char *ip_argv[8];
close_pack_index(p);
@@ -2046,13 +2045,9 @@ int finish_http_pack_request(struct http_pack_request *preq)
die("BUG: pack tmpfile does not end in .pack.temp?");
tmp_idx = xstrfmt("%.*s.idx.temp", (int)len, preq->tmpfile);
- ip_argv[0] = "index-pack";
- ip_argv[1] = "-o";
- ip_argv[2] = tmp_idx;
- ip_argv[3] = preq->tmpfile;
- ip_argv[4] = NULL;
-
- ip.argv = ip_argv;
+ argv_array_push(&ip.args, "index-pack");
+ argv_array_pushl(&ip.args, "-o", tmp_idx, NULL);
+ argv_array_push(&ip.args, preq->tmpfile);
ip.git_cmd = 1;
ip.no_stdin = 1;
ip.no_stdout = 1;