Revert "retry request without query when info/refs?query fails"

This reverts commit 703e6e76a14825e5b0c960d525f34e607154b4f7. Retrying without the query parameter was added as a workaround for a single broken HTTP server at git.debian.org[1]. The server was misconfigured to route every request with a query parameter into gitweb.cgi. Admins fixed the server's configuration within 16 hours of the bug report to the Git mailing list, but we still patched Git with this fallback and have been paying for it since. Most Git hosting services configure the smart HTTP protocol and the retry logic confuses users when there is a transient HTTP error as Git dropped the real error from the smart HTTP request. Removing the retry makes root causes easier to identify. [1] http://thread.gmane.org/gmane.comp.version-control.git/137609 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Shawn O. Pearce committed Sep 19, 2012 at 22:58 UTC 6ac964a627e02ac73d4c97c492acf604942030e9
1 file changed +2 -16
remote-curl.c
+2 -16
@@ -95,7 +95,7 @@ static struct discovery* discover_refs(const char *service)
95 struct strbuf buffer = STRBUF_INIT;
96 struct discovery *last = last_discovery;
97 char *refs_url;
98 - int http_ret, is_http = 0, proto_git_candidate = 1;
98 + int http_ret, is_http = 0;
99
100 if (last && !strcmp(service, last->service))
101 return last;
@@ -113,19 +113,6 @@ static struct discovery* discover_refs(const char *service)
113 refs_url = strbuf_detach(&buffer, NULL);
114
115 http_ret = http_get_strbuf(refs_url, &buffer, HTTP_NO_CACHE);
116 -
117 - /* try again with "plain" url (no ? or & appended) */
118 - if (http_ret != HTTP_OK && http_ret != HTTP_NOAUTH) {
119 - free(refs_url);
120 - strbuf_reset(&buffer);
121 -
122 - proto_git_candidate = 0;
123 - strbuf_addf(&buffer, "%sinfo/refs", url);
124 - refs_url = strbuf_detach(&buffer, NULL);
125 -
126 - http_ret = http_get_strbuf(refs_url, &buffer, HTTP_NO_CACHE);
127 - }
128 -
116 switch (http_ret) {
117 case HTTP_OK:
118 break;
@@ -144,8 +131,7 @@ static struct discovery* discover_refs(const char *service)
131 last->buf_alloc = strbuf_detach(&buffer, &last->len);
132 last->buf = last->buf_alloc;
133
147 - if (is_http && proto_git_candidate
148 - && 5 <= last->len && last->buf[4] == '#') {
134 + if (is_http && 5 <= last->len && last->buf[4] == '#') {
135 /* smart HTTP response; validate that the service
136 * pkt-line matches our request.
137 */