[PATCH] Fix test failure due to overly strict .git directory tests
[gitweb.git] / git-fetch-script
index a0326f0e789145ee93f188d5bb3855d8a029bd6b..ea097144f712f9ef1beb0531f1bf945db9485c3f 100755 (executable)
@@ -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
@@ -31,6 +31,10 @@ rsync://*)
        ;;
 *)
        head=$(git-fetch-pack "$merge_repo" "$merge_head")
+       if h=`expr "$head" : '\([^ ][^ ]*\) '`
+       then
+           head=$h
+       fi
        ;;
 esac || exit 1