]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sequencer: always commit without editing when asked for
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 27 Apr 2018 20:48:28 +0000 (22:48 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 May 2018 22:47:47 +0000 (07:47 +0900)
Previously, we only called run_git_commit() without EDIT_MSG when we also
passed in a default message.

However, an upcoming caller will want to commit without EDIT_MSG and
*without* a default message: to clean up fixup/squash comments in HEAD's
commit message.

Let's prepare for that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c

index 3ce45fce80dd78e27d6d2be46dd1c4a6c6d65c81..6b2f01f6d6bb15a1208c3a75c919262dadffa45e 100644 (file)
@@ -716,6 +716,8 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
                argv_array_pushf(&cmd.args, "-S%s", opts->gpg_sign);
        if (defmsg)
                argv_array_pushl(&cmd.args, "-F", defmsg, NULL);
+       else if (!(flags & EDIT_MSG))
+               argv_array_pushl(&cmd.args, "-C", "HEAD", NULL);
        if ((flags & CLEANUP_MSG))
                argv_array_push(&cmd.args, "--cleanup=strip");
        if ((flags & EDIT_MSG))