Skip to content

Commit 6ac964a

Browse files
spearcegitster
authored andcommitted
Revert "retry request without query when info/refs?query fails"
This reverts commit 703e6e7. 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 <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 25ae7cf commit 6ac964a

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

remote-curl.c

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static struct discovery* discover_refs(const char *service)
9595
struct strbuf buffer = STRBUF_INIT;
9696
struct discovery *last = last_discovery;
9797
char *refs_url;
98-
int http_ret, is_http = 0, proto_git_candidate = 1;
98+
int http_ret, is_http = 0;
9999

100100
if (last && !strcmp(service, last->service))
101101
return last;
@@ -113,19 +113,6 @@ static struct discovery* discover_refs(const char *service)
113113
refs_url = strbuf_detach(&buffer, NULL);
114114

115115
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-
129116
switch (http_ret) {
130117
case HTTP_OK:
131118
break;
@@ -144,8 +131,7 @@ static struct discovery* discover_refs(const char *service)
144131
last->buf_alloc = strbuf_detach(&buffer, &last->len);
145132
last->buf = last->buf_alloc;
146133

147-
if (is_http && proto_git_candidate
148-
&& 5 <= last->len && last->buf[4] == '#') {
134+
if (is_http && 5 <= last->len && last->buf[4] == '#') {
149135
/* smart HTTP response; validate that the service
150136
* pkt-line matches our request.
151137
*/

0 commit comments

Comments
 (0)