aboutsummaryrefslogtreecommitdiff
path: root/git-branch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-branch.sh')
-rwxr-xr-xgit-branch.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-branch.sh b/git-branch.sh
index dcec2a9f2..074229c20 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -14,7 +14,8 @@ If two arguments, create a new branch <branchname> based off of <start-point>.
delete_branch () {
option="$1" branch_name="$2"
- headref=$(readlink "$GIT_DIR/HEAD" | sed -e 's|^refs/heads/||')
+ headref=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD |
+ sed -e 's|^refs/heads/||')
case ",$headref," in
",$branch_name,")
die "Cannot delete the branch you are on." ;;
@@ -67,7 +68,8 @@ done
case "$#" in
0)
- headref=$(readlink "$GIT_DIR/HEAD" | sed -e 's|^refs/heads/||')
+ headref=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD |
+ sed -e 's|^refs/heads/||')
git-rev-parse --symbolic --all |
sed -ne 's|^refs/heads/||p' |
sort |