diff --git a/git-fetch-script b/git-fetch-script
index 34ddfc8cb9dd6171d23be1a534a66533c5bbb676..a0326f0e789145ee93f188d5bb3855d8a029bd6b 100755 (executable)
--- a/git-fetch-script
+++ b/git-fetch-script
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
curl_extra_args="-k"
fi
- head=$(curl -ns $curl_extra_args "$merge_repo/$merge_head") || exit 1
+ _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") &&
+ expr "$head" : "$_x40\$" >/dev/null || {
+ echo >&2 "Failed to fetch $merge_head from $merge_repo"
+ exit 1
+ }
echo Fetching "$merge_head" using http
- git-http-pull -v -a "$head" "$merge_repo/"
+ git-http-pull -v -a "$head" "$merge_repo/" || exit
;;
rsync://*)
rsync -L "$merge_repo/$merge_head" "$TMP_HEAD" || exit 1