http: make redirects more obvious
[gitweb.git] / remote-curl.c
index e3803daa3e0d1635e61490c4d0d60316e2ca06da..05ae8dead777a36eb726d2a8c7681274ae0169de 100644 (file)
@@ -276,6 +276,7 @@ static struct discovery *discover_refs(const char *service, int for_push)
        http_options.charset = &charset;
        http_options.effective_url = &effective_url;
        http_options.base_url = &url;
+       http_options.initial_request = 1;
        http_options.no_cache = 1;
        http_options.keep_error = 1;
 
@@ -294,6 +295,9 @@ static struct discovery *discover_refs(const char *service, int for_push)
                die("unable to access '%s': %s", url.buf, curl_errorstr);
        }
 
+       if (options.verbosity && !starts_with(refs_url.buf, url.buf))
+               warning(_("redirecting to %s"), url.buf);
+
        last= xcalloc(1, sizeof(*last_discovery));
        last->service = service;
        last->buf_alloc = strbuf_detach(&buffer, &last->len);