X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-clone.sh;h=4ed861d576bfaefa768f811a59d2ec53d233b5df;hb=379156e1dc46e0d22f0c7c0c52913c6259c62258;hp=54c9e4ea4c5e486bf7dd4e2b19502d2400c4eb32;hpb=744633cbf23d3ed505f96ffc212b30c96b79fb90;p=git.git diff --git a/git-clone.sh b/git-clone.sh index 54c9e4ea..4ed861d5 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -118,7 +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 +trap 'err=$?; cd ..; rm -r "$D"; exit $err' exit case "$bare" in yes) GIT_DIR="$D" ;; *) GIT_DIR="$D/.git" ;; @@ -154,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"