diff options
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-x | git-rebase.sh | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index 10a238ae3c..7c38c00a1e 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -274,15 +274,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 |