summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-14 07:35:44 -0800
committerJunio C Hamano <gitster@pobox.com>2010-12-14 07:35:44 -0800
commit37ad7ca7dbb0bef2b902f6bc7d3346ddff1667a5 (patch)
tree22fec01c1e15f007c681b68cc217688e1002f5f3 /git-rebase.sh
parente0cbf12bf7d8b46292774ac91db8757d60b0f4df (diff)
parent729ec9e23a13a0610a19a24901d0ab5e2bc44a12 (diff)
downloadgit-37ad7ca7dbb0bef2b902f6bc7d3346ddff1667a5.tar.gz
Merge branch 'mz/rebase-abort-reflog-fix' into maint
* 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 ec08f9cff5..6a7e5e0b18 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