From affa40d2f8c5e72af5896cf395ef77d4162908cd Mon Sep 17 00:00:00 2001 From: Catalin Marinas Date: Mon, 8 Aug 2005 10:53:23 +0100 Subject: [PATCH] Make curl fail on server error Some http servers return an HTML error page and git reads it as normal data. Adding -f option makes curl fail silently. Signed-off-by: Catalin Marinas Signed-off-by: Junio C Hamano diff --git a/git-clone-dumb-http b/git-clone-dumb-http index 8203c67..5052708 100755 --- a/git-clone-dumb-http +++ b/git-clone-dumb-http @@ -14,7 +14,7 @@ if [ -n "$GIT_SSL_NO_VERIFY" ]; then fi http_fetch () { # $1 = Remote, $2 = Local - curl -ns $curl_extra_args "$1" >"$2" + curl -nsf $curl_extra_args "$1" >"$2" } cd "$D" && diff --git a/git-fetch-script b/git-fetch-script index a0326f0..24f0a5e 100755 --- a/git-fetch-script +++ b/git-fetch-script @@ -15,7 +15,7 @@ http://* | https://*) fi _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' && _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" && - head=$(curl -ns $curl_extra_args "$merge_repo/$merge_head") && + head=$(curl -nsf $curl_extra_args "$merge_repo/$merge_head") && expr "$head" : "$_x40\$" >/dev/null || { echo >&2 "Failed to fetch $merge_head from $merge_repo" exit 1 diff --git a/git-ls-remote-script b/git-ls-remote-script index 921d3f8..31cdac8 100755 --- a/git-ls-remote-script +++ b/git-ls-remote-script @@ -46,7 +46,7 @@ http://* | https://* ) if [ -n "$GIT_SSL_NO_VERIFY" ]; then curl_extra_args="-k" fi - curl -ns $curl_extra_args "$peek_repo/info/refs" || exit 1 + curl -nsf $curl_extra_args "$peek_repo/info/refs" || exit 1 ;; rsync://* ) -- cgit v0.10.2-6-g49f6