summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 358ddb6)
raw | patch | inline | side by side (parent: 358ddb6)
author | Linus Torvalds <torvalds@osdl.org> | |
Fri, 15 Sep 2006 21:56:55 +0000 (14:56 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 16 Sep 2006 09:23:51 +0000 (02:23 -0700) |
That way, it doesn't care how the refs are stored any more
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-checkout.sh | patch | blob | history |
diff --git a/git-checkout.sh b/git-checkout.sh
index 580a9e8a233f0a94c84792eba7c3dc653fccf3a0..f03620b054ea81554e293dabf0884cac12bb73e4 100755 (executable)
--- a/git-checkout.sh
+++ b/git-checkout.sh
shift
[ -z "$newbranch" ] &&
die "git checkout: -b needs a branch name"
- [ -e "$GIT_DIR/refs/heads/$newbranch" ] &&
+ git-show-ref --verify --quiet -- "refs/heads/$newbranch" &&
die "git checkout: branch $newbranch already exists"
git-check-ref-format "heads/$newbranch" ||
die "git checkout: we do not like '$newbranch' as a branch name."
fi
new="$rev"
new_name="$arg^0"
- if [ -f "$GIT_DIR/refs/heads/$arg" ]; then
+ if git-show-ref --verify --quiet -- "refs/heads/$arg"
+ then
branch="$arg"
fi
elif rev=$(git-rev-parse --verify "$arg^{tree}" 2>/dev/null)