Merge branch 'jc/mv'
[gitweb.git] / git-clone.sh
index 47f3ec9761ba3e681e3035e6ae1c7449a6177a5e..d184ceb7a6f2a7d4ffc3a002b1a8846c46297f33 100755 (executable)
@@ -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
+