aboutsummaryrefslogtreecommitdiff
path: root/git-branch.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2006-09-17 06:32:24 +0200
committerJunio C Hamano <junkio@cox.net>2006-09-17 02:43:08 -0700
commitee1a9b2f1824100bbac8d23e7dea1a6e9e85fb21 (patch)
tree97452fa54fc9cde60a6518094a093675b494baee /git-branch.sh
parentc40abef89f746ef7b9b7815b12b740e2f22905c8 (diff)
downloadgit-ee1a9b2f1824100bbac8d23e7dea1a6e9e85fb21.tar.gz
git-ee1a9b2f1824100bbac8d23e7dea1a6e9e85fb21.tar.xz
Use Linus' show ref in "git-branch.sh".
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-branch.sh')
-rwxr-xr-xgit-branch.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-branch.sh b/git-branch.sh
index e0501ec23..2600e9c4a 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -21,7 +21,7 @@ delete_branch () {
,,)
die "What branch are you on anyway?" ;;
esac
- branch=$(cat "$GIT_DIR/refs/heads/$branch_name") &&
+ branch=$(git-show-ref --verify --hash -- "refs/heads/$branch_name") &&
branch=$(git-rev-parse --verify "$branch^0") ||
die "Seriously, what branch are you talking about?"
case "$option" in
@@ -112,7 +112,7 @@ rev=$(git-rev-parse --verify "$head") || exit
git-check-ref-format "heads/$branchname" ||
die "we do not like '$branchname' as a branch name."
-if [ -e "$GIT_DIR/refs/heads/$branchname" ]
+if git-show-ref --verify --quiet -- "refs/heads/$branchname"
then
if test '' = "$force"
then