summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-01-02 15:26:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-09 22:57:29 (GMT)
commit23aa51420cca7bee854f54e970206c00f3be0c86 (patch)
treebd8a97dffeb93d1d1a9c340f840c2a2a855fefff /sequencer.c
parenta70d8f8067640070d89d0764d0dee491f8e0bd13 (diff)
downloadgit-23aa51420cca7bee854f54e970206c00f3be0c86.zip
git-23aa51420cca7bee854f54e970206c00f3be0c86.tar.gz
git-23aa51420cca7bee854f54e970206c00f3be0c86.tar.bz2
sequencer: use a helper to find the commit message
It is actually not safe to look for a commit message by looking for the first empty line and skipping it. The find_commit_subject() function looks more carefully, so let's use it. Since we are interested in the entire commit message, we re-compute the string length after verifying that the commit subject is not empty (in which case the entire commit message would be empty, something that should not happen but that we want to handle gracefully). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sequencer.c b/sequencer.c
index 3eededc..720857b 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -703,14 +703,9 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
next = commit;
next_label = msg.label;
- /*
- * Append the commit log message to msgbuf; it starts
- * after the tree, parent, author, committer
- * information followed by "\n\n".
- */
- p = strstr(msg.message, "\n\n");
- if (p)
- strbuf_addstr(&msgbuf, skip_blank_lines(p + 2));
+ /* Append the commit log message to msgbuf. */
+ if (find_commit_subject(msg.message, &p))
+ strbuf_addstr(&msgbuf, p);
if (opts->record_origin) {
if (!has_conforming_footer(&msgbuf, NULL, 0))