@matheusbsbs / matheus-bagliano / commits / 66c9ec2555
Fork 0

Let git-clone/git-fetch follow HTTP redirections

Otherwise, git-clone silently failed to clone a remote repository where redirections (ie. a response with a "Location" header line) are used. This includes the fixes from Nick Hengeveld. Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Josef Weidendorfer committed Nov 10, 2005 at 14:12 UTC 66c9ec25553ce7332c46e2017b9c4d7c26310fff
3 files changed +4 -2
git-clone.sh
+1 -1
@@ -23,7 +23,7 @@ fi
23
24 http_fetch () {
25 # $1 = Remote, $2 = Local
26 - curl -nsf $curl_extra_args "$1" >"$2"
26 + curl -nsfL $curl_extra_args "$1" >"$2"
27 }
28
29 clone_dumb_http () {
git-fetch.sh
+1 -1
@@ -230,7 +230,7 @@ do
230 $u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg;
231 print "$u";
232 ' "$remote_name")
233 - head=$(curl -nsf $curl_extra_args "$remote/$remote_name_quoted") &&
233 + head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted") &&
234 expr "$head" : "$_x40\$" >/dev/null ||
235 die "Failed to fetch $remote_name from $remote"
236 echo >&2 Fetching "$remote_name from $remote" using http
http-fetch.c
+2
@@ -269,6 +269,8 @@ static CURL* get_curl_handle(void)
269 curl_low_speed_time);
270 }
271
272 + curl_easy_setopt(result, CURLOPT_FOLLOWLOCATION, 1);
273 +
274 return result;
275 }
276