Merge branch 'rs/use-argv-array-in-child-process'
authorJunio C Hamano <gitster@pobox.com>
Fri, 5 Jan 2018 21:28:10 +0000 (13:28 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Jan 2018 21:28:10 +0000 (13:28 -0800)
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

1  2 
http.c
diff --combined http.c
index 32d33261c98cce2d5fd25c07a503654a3d5d2e52,9f2fcc9ec45884e7a8741e960e1f867fc560adaf..5977712712b22d9076d8cd5ccda0fe12b3057d27
--- 1/http.c
--- 2/http.c
+++ b/http.c
@@@ -865,11 -865,6 +865,11 @@@ static CURL *get_curl_handle(void
                else if (starts_with(curl_http_proxy, "socks"))
                        curl_easy_setopt(result,
                                CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
 +#endif
 +#if LIBCURL_VERSION_NUM >= 0x073400
 +              else if (starts_with(curl_http_proxy, "https"))
 +                      curl_easy_setopt(result,
 +                              CURLOPT_PROXYTYPE, CURLPROXY_HTTPS);
  #endif
                if (strstr(curl_http_proxy, "://"))
                        credential_from_url(&proxy_auth, curl_http_proxy);
@@@ -2030,7 -2025,6 +2030,6 @@@ int finish_http_pack_request(struct htt
        char *tmp_idx;
        size_t len;
        struct child_process ip = CHILD_PROCESS_INIT;
-       const char *ip_argv[8];
  
        close_pack_index(p);
  
                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;