]> git.ipfire.org Git - thirdparty/git.git/commit - sequencer.c
rebase --continue: refuse to commit after failed command
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 6 Sep 2023 15:22:50 +0000 (15:22 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Sep 2023 17:29:44 +0000 (10:29 -0700)
commit405509cbd66b2149fcce6e71c0eb0704c241a826
tree6b81572c1434e9be1ed888140fb581fba0cd6074
parente032abd5a0bec40a700527f71073f3ba21fce7d6
rebase --continue: refuse to commit after failed command

If a commit cannot be picked because it would overwrite an untracked
file then "git rebase --continue" should refuse to commit any staged
changes as the commit was not picked. This is implemented by refusing to
commit if the message file is missing. The message file is chosen for
this check because it is only written when "git rebase" stops for the
user to resolve merge conflicts.

Existing commands that refuse to commit staged changes when continuing
such as a failed "exec" rely on checking for the absence of the author
script in run_git_commit(). This prevents the staged changes from being
committed but prints

    error: could not open '.git/rebase-merge/author-script' for
    reading

before the message about not being able to commit. This is confusing to
users and so checking for the message file instead improves the user
experience. The existing test for refusing to commit after a failed exec
is updated to check that we do not print the error message about a
missing author script anymore.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
t/t3404-rebase-interactive.sh
t/t3430-rebase-merges.sh