Keep Porcelainish from failing by broken ident after making changes.
[git.git] / git-clone.sh
index 47f3ec9..d184ceb 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
+