{"thread":{"id":"2429","subject":"[PATCH] Let git-clone/git-fetch follow HTTP redirections","startedAt":"2005-11-10T13:12:19Z","lastAt":"2005-11-10T13:12:19Z","messageCount":1,"participants":["Josef Weidendorfer"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11474","messageId":"200511101412.20069.Josef.Weidendorfer@gmx.de","threadId":"2429","inReplyTo":null,"subject":"[PATCH] Let git-clone/git-fetch follow HTTP redirections","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-11-10T13:12:19Z","receivedAt":"2005-11-10T13:12:19Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"Let git-clone/git-fetch follow HTTP redirections\n\nOtherwise, git-clone silently failed to clone a remote\nrepository where redirections (ie. a response with a\n\"Location\" header line) are used.\n\nThis includes the fixes from Nick Hengeveld.\n\nSigned-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n\n---\n\n git-clone.sh |    2 +-\n git-fetch.sh |    2 +-\n http-fetch.c |    2 ++\n 3 files changed, 4 insertions(+), 2 deletions(-)\n\napplies-to: f4d9606c4e4ca69203ea9211547083009b34196e\nf6bf6aee48c028a4166d4c5d54c8e3c136721e3c\ndiff --git a/git-clone.sh b/git-clone.sh\nindex 4fdd652..aafcc18 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -23,7 +23,7 @@ fi\n \n http_fetch () {\n \t# $1 = Remote, $2 = Local\n-\tcurl -nsf $curl_extra_args \"$1\" >\"$2\"\n+\tcurl -nsfL $curl_extra_args \"$1\" >\"$2\"\n }\n \n clone_dumb_http () {\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 31e5f4c..8564cbf 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -230,7 +230,7 @@ do\n \t    $u =~ s{([^-a-zA-Z0-9/.])}{sprintf\"%%%02x\",ord($1)}eg;\n \t    print \"$u\";\n \t' \"$remote_name\")\n-\thead=$(curl -nsf $curl_extra_args \"$remote/$remote_name_quoted\") &&\n+\thead=$(curl -nsfL $curl_extra_args \"$remote/$remote_name_quoted\") &&\n \texpr \"$head\" : \"$_x40\\$\" >/dev/null ||\n \t\tdie \"Failed to fetch $remote_name from $remote\"\n \techo >&2 Fetching \"$remote_name from $remote\" using http\ndiff --git a/http-fetch.c b/http-fetch.c\nindex ea8af1b..28d225c 100644\n--- a/http-fetch.c\n+++ b/http-fetch.c\n@@ -269,6 +269,8 @@ static CURL* get_curl_handle(void)\n \t\t\t\t curl_low_speed_time);\n \t}\n \n+\tcurl_easy_setopt(result, CURLOPT_FOLLOWLOCATION, 1);\n+\n \treturn result;\n }\n \n---\n0.99.9.GIT\n"}]}