From: Christian Couder Date: Sun, 17 Sep 2006 04:32:24 +0000 (+0200) Subject: Use Linus' show ref in "git-branch.sh". X-Git-Tag: v1.4.4-rc1~43^2~19^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ee1a9b2f1824100bbac8d23e7dea1a6e9e85fb21;p=git.git Use Linus' show ref in "git-branch.sh". Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- 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