@matheusbsbs / matheus-bagliano / commits / 6851162adf
Fork 0

clone: correctly report http_fetch errors

The exit status from curl was accidentally lost by the 'case' statement. We need to explicitly save it so that $? doesn't get overwritten. This improves the error message when fetching from an http repository which has never had update-server-info run. Previously, it would fail to note the fetch error and produce multiple errors about the lack of origin branches. It now correctly suggests running git-update-server-info. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Dec 17, 2007 at 07:43 UTC 6851162adf29762cd121555645214468451a3111
1 file changed +6 -5
git-clone.sh
+6 -5
@@ -35,11 +35,12 @@ fi
35
36 http_fetch () {
37 # $1 = Remote, $2 = Local
38 - curl -nsfL $curl_extra_args "$1" >"$2" ||
39 - case $? in
40 - 126|127) exit ;;
41 - *) return $? ;;
42 - esac
38 + curl -nsfL $curl_extra_args "$1" >"$2"
39 + curl_exit_status=$?
40 + case $curl_exit_status in
41 + 126|127) exit ;;
42 + *) return $curl_exit_status ;;
43 + esac
44 }
45
46 clone_dumb_http () {