From 14c98218845ad2acbd42b8d913503ff6fb3fd2ac Mon Sep 17 00:00:00 2001 From: Sam Vilain Date: Tue, 4 Dec 2007 10:48:54 +1300 Subject: Add remote..proxy As well as allowing a default http.proxy option, allow it to be set per-remote. Signed-off-by: Sam Vilain Signed-off-by: Junio C Hamano --- transport.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'transport.c') diff --git a/transport.c b/transport.c index 50db9807d0..3eb93b4875 100644 --- a/transport.c +++ b/transport.c @@ -470,6 +470,10 @@ static struct ref *get_refs_via_curl(struct transport *transport) 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) { -- cgit v1.2.3 From c6bc40058565fef3ec79840bf5e13ba0962cb3e4 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 4 Dec 2007 23:01:19 -0800 Subject: do not discard status in fetch_refs_via_pack() The code calls fetch_pack() to get the list of refs it fetched, and discards refs and always returns 0 to signal success. But builtin-fetch-pack.c::fetch_pack() has error cases. The function returns NULL if error is detected (shallow-support side seems to choose to die but I suspect that is easily fixable to error out as well). Make fetch_refs_via_pack() propagate that error to the caller. Acked-By: Daniel Barkalow Signed-off-by: Junio C Hamano --- transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'transport.c') diff --git a/transport.c b/transport.c index 3eb93b4875..58e66f6c11 100644 --- a/transport.c +++ b/transport.c @@ -659,7 +659,7 @@ static int fetch_refs_via_pack(struct transport *transport, free(heads); free_refs(refs); free(dest); - return 0; + return (refs ? 0 : -1); } static int git_transport_push(struct transport *transport, int refspec_nr, const char **refspec, int flags) -- cgit v1.2.3