Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-rebase: allow rebasing a detached HEAD.
author
Junio C Hamano
<junkio@cox.net>
Sun, 21 Jan 2007 03:11:29 +0000
(19:11 -0800)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 21 Jan 2007 05:31:00 +0000
(21:31 -0800)
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-rebase.sh
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
11a6ddb
)
diff --git
a/git-rebase.sh
b/git-rebase.sh
index c8bd0f99d1306cd311eaf45f73581efc8bb0e512..99cedadda1da1ba2f62c22acfbd6477b1b2b38cb 100755
(executable)
--- a/
git-rebase.sh
+++ b/
git-rebase.sh
@@
-275,8
+275,12
@@
case "$#" in
git-checkout "$2" || usage
;;
*)
- branch_name=`git symbolic-ref HEAD` || die "No current branch"
- branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
+ if branch_name=`git symbolic-ref -q HEAD`
+ then
+ branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
+ else
+ branch_name=HEAD ;# detached
+ fi
;;
esac
branch=$(git-rev-parse --verify "${branch_name}^0") || exit