]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-rebase--interactive.sh
builtin-commit.c: do not remove COMMIT_EDITMSG
[git.git] / git-rebase--interactive.sh
index bdec43c3f604b22d29b52bd6a026785a6ac0f21b..59c148ff6d477c5c40258d3adc5c95f5c775ccc6 100755 (executable)
@@ -277,7 +277,7 @@ do_next () {
                "$DOTEST"/amend || exit
        read command sha1 rest < "$TODO"
        case "$command" in
-       '#'*|'')
+       '#'*|''|noop)
                mark_action_done
                ;;
        pick|p)
@@ -309,7 +309,7 @@ do_next () {
        squash|s)
                comment_for_reflog squash
 
-               has_action "$DONE" ||
+               test -f "$DONE" && has_action "$DONE" ||
                        die "Cannot 'squash' without a previous commit"
 
                mark_action_done
@@ -584,6 +584,7 @@ first and then run 'git rebase --continue' again."
                        --abbrev=7 --reverse --left-right --cherry-pick \
                        $UPSTREAM...$HEAD | \
                        sed -n "s/^>/pick /p" > "$TODO"
+               test -s "$TODO" || echo noop >> "$TODO"
                cat >> "$TODO" << EOF
 
 # Rebase $SHORTUPSTREAM..$SHORTHEAD onto $SHORTONTO