X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-clone.sh;h=d96894d4c2aa6e6c0aa38ca0755ffa16ace2161c;hb=ac6245e31a359200b65bfdd910bba9a0fbe90c11;hp=0805168057c871549d87ff4e9e30d654abbed0a4;hpb=f327dbced25a3c6fcc0b84d2d6adffa9343b09f0;p=git.git diff --git a/git-clone.sh b/git-clone.sh index 08051680..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