Merge branch 'en/sequencer-empty-edit-result-aborts'

"git rebase" etc. in Git 2.19 fails to abort when given an empty
commit log message as result of editing, which has been corrected.

* en/sequencer-empty-edit-result-aborts:
  sequencer: fix --allow-empty-message behavior, make it smarter
This commit is contained in:
Junio C Hamano
2018-09-24 10:30:52 -07:00
4 changed files with 14 additions and 17 deletions

View File

@ -903,7 +903,7 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
if ((flags & ALLOW_EMPTY))
argv_array_push(&cmd.args, "--allow-empty");
if (opts->allow_empty_message)
if (!(flags & EDIT_MSG))
argv_array_push(&cmd.args, "--allow-empty-message");
if (cmd.err == -1) {
@ -1317,7 +1317,7 @@ static int try_to_commit(struct strbuf *msg, const char *author,
if (cleanup != COMMIT_MSG_CLEANUP_NONE)
strbuf_stripspace(msg, cleanup == COMMIT_MSG_CLEANUP_ALL);
if (!opts->allow_empty_message && message_is_empty(msg, cleanup)) {
if ((flags & EDIT_MSG) && message_is_empty(msg, cleanup)) {
res = 1; /* run 'git commit' to display error message */
goto out;
}