X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-clone.sh;h=dc0ad552a322d46f48bee2c8d324285a63a9b8c7;hb=8c0db2f5193153ea8a51bb45b0512c5a3889023b;hp=e192b08c0dc3ab410e371fe07af96b9b5b59f22a;hpb=5f906b1c34a174fb6a5eb03f8063859d1a487721;p=git.git diff --git a/git-clone.sh b/git-clone.sh index e192b08c..dc0ad552 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" ;; @@ -153,7 +154,7 @@ yes,yes) fi && rm -f "$GIT_DIR/objects/sample" && cd "$repo" && - find objects -depth -print | cpio -puamd$l "$GIT_DIR/" || exit 1 + find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1 ;; yes) mkdir -p "$GIT_DIR/objects/info" @@ -255,3 +256,6 @@ Pull: $head_points_at:$origin" && git checkout esac fi + +trap - exit +