Code

Git 1.7.1.2
[git.git] / git-rebase--interactive.sh
index b817c4a76e54c31f5a21d8196729f0cfb31997cf..6b86abc64bfe0034caf23cf9530955128766de32 100755 (executable)
@@ -565,6 +565,7 @@ do_next () {
                        git diff-tree --stat $(cat "$DOTEST"/head)..HEAD
        } &&
        {
+               test -s "$REWRITTEN_LIST" &&
                git notes copy --for-rewrite=rebase < "$REWRITTEN_LIST" ||
                true # we don't care if this copying failed
        } &&
@@ -973,8 +974,9 @@ EOF
 
                test -d "$REWRITTEN" || test -n "$NEVER_FF" || skip_unnecessary_picks
 
+               output git checkout $ONTO || die_abort "could not detach HEAD"
                git update-ref ORIG_HEAD $HEAD
-               output git checkout $ONTO && do_rest
+               do_rest
                ;;
        esac
        shift