summaryrefslogtreecommitdiff
path: root/http-walker.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-03-04 08:36:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-06 18:52:15 (GMT)
commitde46138826cbc8229e25691e613e09ae1f683235 (patch)
treec31cd7ed0ada1d57871227383ce933408634d254 /http-walker.c
parente7e07d5a4fcc2a203d9873968ad3e6bd4d7419d7 (diff)
downloadgit-de46138826cbc8229e25691e613e09ae1f683235.zip
git-de46138826cbc8229e25691e613e09ae1f683235.tar.gz
git-de46138826cbc8229e25691e613e09ae1f683235.tar.bz2
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>
Diffstat (limited to 'http-walker.c')
-rw-r--r--http-walker.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/http-walker.c b/http-walker.c
index b34b6ac..6396ceb 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -168,6 +168,11 @@ static int is_alternate_allowed(const char *url)
};
int i;
+ if (http_follow_config != HTTP_FOLLOW_ALWAYS) {
+ warning("alternate disabled by http.followRedirects: %s", url);
+ return 0;
+ }
+
for (i = 0; i < ARRAY_SIZE(protocols); i++) {
const char *end;
if (skip_prefix(url, protocols[i], &end) &&
@@ -331,9 +336,6 @@ static void fetch_alternates(struct walker *walker, const char *base)
struct alternates_request alt_req;
struct walker_data *cdata = walker->data;
- if (http_follow_config != HTTP_FOLLOW_ALWAYS)
- return;
-
/*
* If another request has already started fetching alternates,
* wait for them to arrive and return to processing this request's