Skip to content

Commit 8a477dd

Browse files
committed
Merge branch 'sp/maint-http-info-refs-no-retry' into maint
"git fetch" over http had an old workaround for an unlikely server misconfiguration; it turns out that this hurts debuggability of the configuration in general, and has been reverted. * sp/maint-http-info-refs-no-retry: Revert "retry request without query when info/refs?query fails"
2 parents a907309 + 6ac964a commit 8a477dd

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)