summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b319ce4)
raw | patch | inline | side by side (parent: b319ce4)
author | Sam Vilain <sam.vilain@catalyst.net.nz> | |
Fri, 23 Nov 2007 00:07:00 +0000 (13:07 +1300) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 4 Dec 2007 06:11:53 +0000 (22:11 -0800) |
The http_proxy / HTTPS_PROXY variables used by curl to control
proxying may not be suitable for git. Allow the user to override them
in the configuration file.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
proxying may not be suitable for git. Allow the user to override them
in the configuration file.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt | patch | blob | history | |
http.c | patch | blob | history |
index 4124ad2970cfd76eb6592658c02007188c48003a..15745de67bb5c05f3a3454d2d985b7d04b8c899a 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
is one of "ext" and "pserver") to make them apply only for the given
access method.
+http.proxy::
+ Override the HTTP proxy, normally configured using the 'http_proxy'
+ environment variable (see gitlink:curl[1]).
+
http.sslVerify::
Whether to verify the SSL certificate when fetching or pushing
over HTTPS. Can be overridden by the 'GIT_SSL_NO_VERIFY' environment
index 87ebf7b86548d229afbfd9263d2470296a7b2ac7..e4aa9c19dbe7fd2ed948d5cca255a7db44a9472f 100644 (file)
--- a/http.c
+++ b/http.c
long curl_low_speed_limit = -1;
long curl_low_speed_time = -1;
int curl_ftp_no_epsv = 0;
+char *curl_http_proxy = NULL;
struct curl_slist *pragma_header;
curl_ftp_no_epsv = git_config_bool(var, value);
return 0;
}
+ if (!strcmp("http.proxy", var)) {
+ if (curl_http_proxy == NULL) {
+ curl_http_proxy = xmalloc(strlen(value)+1);
+ strcpy(curl_http_proxy, value);
+ }
+ return 0;
+ }
/* Fall back on the default ones */
return git_default_config(var, value);
if (curl_ftp_no_epsv)
curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);
+ if (curl_http_proxy)
+ curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
+
return result;
}