X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-clone.sh;h=d184ceb7a6f2a7d4ffc3a002b1a8846c46297f33;hb=a18b63276281708143be7a7828bf106c88a7b307;hp=e192b08c0dc3ab410e371fe07af96b9b5b59f22a;hpb=be97bd1b88003f4a19e2832ee0cc6ac20fcab674;p=git.git diff --git a/git-clone.sh b/git-clone.sh index e192b08c..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" ;; @@ -255,3 +256,6 @@ Pull: $head_points_at:$origin" && git checkout esac fi + +trap - exit +