X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-clone.sh;h=d184ceb7a6f2a7d4ffc3a002b1a8846c46297f33;hb=a18b63276281708143be7a7828bf106c88a7b307;hp=47f3ec9761ba3e681e3035e6ae1c7449a6177a5e;hpb=92643a27cc2cc7ce55ba2afd6155f94b40e1aa89;p=git.git diff --git a/git-clone.sh b/git-clone.sh index 47f3ec97..d184ceb7 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -118,6 +118,7 @@ dir="$2" [ -e "$dir" ] && echo "$dir already exists." && usage mkdir -p "$dir" && D=$(cd "$dir" && pwd) && +trap 'err=$?; rm -r $D; exit $err' exit case "$bare" in yes) GIT_DIR="$D" ;; *) GIT_DIR="$D/.git" ;; @@ -206,7 +207,13 @@ yes,yes) fi ;; http://*) - clone_dumb_http "$repo" "$D" + if test -z "@@NO_CURL@@" + then + clone_dumb_http "$repo" "$D" + else + echo >&2 "http transport not supported, rebuild Git with curl support" + exit 1 + fi ;; *) cd "$D" && case "$upload_pack" in @@ -249,3 +256,6 @@ Pull: $head_points_at:$origin" && git checkout esac fi + +trap - exit +