[PATCH v4 3/4] sequencer: always commit without editing when asked for
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Apr 27, 2018, 20:48 UTC
- Message-ID
- <b4c41988ab591e5b67c78cca91c834ddfc8ded84.1524862093.git.johannes.schindelin@gmx.de>
- In-Reply-To
- <cover.1524862093.git.johannes.schindelin@gmx.de>
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> --- sequencer.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/sequencer.c b/sequencer.c index d2e6f33023d..56166b0d6c7 100644 --- a/sequencer.c +++ b/sequencer.c @@ -717,6 +717,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))
-- 2.17.0.windows.1.33.gfcbb1fa0445