diff options
Diffstat (limited to 'git-clone.sh')
-rwxr-xr-x | git-clone.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/git-clone.sh b/git-clone.sh index e192b08c0d..4ed861d576 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=$?; cd ..; 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" @@ -252,6 +253,9 @@ Pull: $head_points_at:$origin" && case "$no_checkout" in '') - git checkout + git-read-tree -m -u -v HEAD HEAD esac fi + +trap - exit + |