projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use git-update-ref and git-symbolic-ref in tests
[git.git]
/
git-branch.sh
diff --git
a/git-branch.sh
b/git-branch.sh
index
dcec2a9
..
074229c
100755
(executable)
--- 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"
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." ;;
case ",$headref," in
",$branch_name,")
die "Cannot delete the branch you are on." ;;
@@
-67,7
+68,8
@@
done
case "$#" in
0)
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 |
git-rev-parse --symbolic --all |
sed -ne 's|^refs/heads/||p' |
sort |