summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9c5665a)
raw | patch | inline | side by side (parent: 9c5665a)
author | Sam Vilain <sam.vilain@catalyst.net.nz> | |
Mon, 3 Dec 2007 21:48:54 +0000 (10:48 +1300) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 4 Dec 2007 07:43:07 +0000 (23:43 -0800) |
As well as allowing a default http.proxy option, allow it to be set
per-remote.
Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
per-remote.
Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt | patch | blob | history | |
remote.c | patch | blob | history | |
remote.h | patch | blob | history | |
transport.c | patch | blob | history |
index 15745de67bb5c05f3a3454d2d985b7d04b8c899a..6ae11842e5d71f201f8901922db8d9bdafb2d17b 100644 (file)
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
http.proxy::
Override the HTTP proxy, normally configured using the 'http_proxy'
- environment variable (see gitlink:curl[1]).
+ environment variable (see gitlink:curl[1]). This can be overridden
+ on a per-remote basis; see remote.<name>.proxy
http.sslVerify::
Whether to verify the SSL certificate when fetching or pushing
The URL of a remote repository. See gitlink:git-fetch[1] or
gitlink:git-push[1].
+remote.<name>.proxy::
+ For remotes that require curl (http, https and ftp), the URL to
+ the proxy to use for that remote. Set to the empty string to
+ disable proxying for that remote.
+
remote.<name>.fetch::
The default set of "refspec" for gitlink:git-fetch[1]. See
gitlink:git-fetch[1].
diff --git a/remote.c b/remote.c
index bb010590837fd6ea188e64c5263bb1fe12ab93f4..46e5f04243eb6075a91ac70350555d1aa521f802 100644 (file)
--- a/remote.c
+++ b/remote.c
} else if (!strcmp(subkey, ".tagopt")) {
if (!strcmp(value, "--no-tags"))
remote->fetch_tags = -1;
+ } else if (!strcmp(subkey, ".proxy")) {
+ remote->http_proxy = xstrdup(value);
}
return 0;
}
diff --git a/remote.h b/remote.h
index b10036cae6f89e087da56979e2248e1e5c5d42d3..86e036d61006a577ad091bdc30e58987871415b0 100644 (file)
--- a/remote.h
+++ b/remote.h
const char *receivepack;
const char *uploadpack;
+
+ /*
+ * for curl remotes only
+ */
+ char *http_proxy;
};
struct remote *remote_get(const char *name);
diff --git a/transport.c b/transport.c
index 50db9807d003162c81f391e08f247bac7ce410c9..3eb93b4875ed0e4884088565a0faa45cc3d287e3 100644 (file)
--- a/transport.c
+++ b/transport.c
curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
curl_easy_setopt(slot->curl, CURLOPT_URL, refs_url);
curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, NULL);
+ if (transport->remote->http_proxy)
+ curl_easy_setopt(slot->curl, CURLOPT_PROXY,
+ transport->remote->http_proxy);
+
if (start_active_slot(slot)) {
run_active_slot(slot);
if (results.curl_result != CURLE_OK) {