X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-clone.sh;h=d96894d4c2aa6e6c0aa38ca0755ffa16ace2161c;hb=e8cc9cd98e2ecd7fd8bb03e725d470405c8e2b94;hp=b78524767c0a3fd8ce99412e1d0b92a9a9ba26fb;hpb=5c222ce2c415ccf7ce1e9281eb49f0a6f26657fa;p=git.git diff --git a/git-clone.sh b/git-clone.sh index b7852476..d96894d4 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -199,7 +199,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 +trap 'err=$?; cd ..; rm -r "$D"; exit $err' 0 case "$bare" in yes) GIT_DIR="$D" ;; *) GIT_DIR="$D/.git" ;; @@ -261,11 +261,7 @@ yes,yes) ;; yes) mkdir -p "$GIT_DIR/objects/info" - { - test -f "$repo/objects/info/alternates" && - cat "$repo/objects/info/alternates"; - echo "$repo/objects" - } >>"$GIT_DIR/objects/info/alternates" + echo "$repo/objects" >> "$GIT_DIR/objects/info/alternates" ;; esac git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" @@ -411,5 +407,5 @@ Pull: refs/heads/$head_points_at:$origin_track" && fi rm -f "$GIT_DIR/CLONE_HEAD" "$GIT_DIR/REMOTE_HEAD" -trap - exit +trap - 0