summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-12 21:49:51 -0800
committerJunio C Hamano <gitster@pobox.com>2010-12-12 21:49:51 -0800
commit6b236bfcb011048a4c2abc6b44290c738a3de699 (patch)
treefc18368e1311b9fdcd0d0dd47d5a65bb04a364cd /git-rebase.sh
parent9f5074e0348071532911cffb622d7df6754a9743 (diff)
parent729ec9e23a13a0610a19a24901d0ab5e2bc44a12 (diff)
downloadgit-6b236bfcb011048a4c2abc6b44290c738a3de699.tar.gz
Merge branch 'mz/rebase-abort-reflog-fix'
* mz/rebase-abort-reflog-fix: rebase --abort: do not update branch ref
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 9a6d7a4730..3459fe4f60 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -275,15 +275,16 @@ do
die "No rebase in progress?"
git rerere clear
- if test -d "$dotest"
- then
- GIT_QUIET=$(cat "$dotest/quiet")
- move_to_original_branch
- else
- dotest="$GIT_DIR"/rebase-apply
- GIT_QUIET=$(cat "$dotest/quiet")
- move_to_original_branch
- fi
+
+ test -d "$dotest" || dotest="$GIT_DIR"/rebase-apply
+
+ head_name="$(cat "$dotest"/head-name)" &&
+ case "$head_name" in
+ refs/*)
+ git symbolic-ref HEAD $head_name ||
+ die "Could not move back to $head_name"
+ ;;
+ esac
git reset --hard $(cat "$dotest/orig-head")
rm -r "$dotest"
exit