http: inform about alternates-as-redirects behavior

It is disconcerting for users to not notice the behavior change in handling alternates from commit cb4d2d35c4622ec2 ("http: treat http-alternates like redirects") Give the user a hint about the config option so they can see the URL and decide whether or not they want to enable http.followRedirects in their config. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Wong committed Mar 4, 2017 at 08:36 UTC de46138826cbc8229e25691e613e09ae1f683235
1 file changed +5 -3
http-walker.c
+5 -3
@@ -168,6 +168,11 @@ static int is_alternate_allowed(const char *url)
168 };
169 int i;
170
171 + if (http_follow_config != HTTP_FOLLOW_ALWAYS) {
172 + warning("alternate disabled by http.followRedirects: %s", url);
173 + return 0;
174 + }
175 +
176 for (i = 0; i < ARRAY_SIZE(protocols); i++) {
177 const char *end;
178 if (skip_prefix(url, protocols[i], &end) &&
@@ -331,9 +336,6 @@ static void fetch_alternates(struct walker *walker, const char *base)
336 struct alternates_request alt_req;
337 struct walker_data *cdata = walker->data;
338
334 - if (http_follow_config != HTTP_FOLLOW_ALWAYS)
335 - return;
336 -
339 /*
340 * If another request has already started fetching alternates,
341 * wait for them to arrive and return to processing this request's