mirror of
https://github.com/git-for-windows/git.git
synced 2026-05-05 17:40:24 -05:00
[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 <catalin.marinas@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
committed by
Junio C Hamano
parent
3c4e8a636f
commit
affa40d2f8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user