sequencer: use skip_blank_lines() to find the commit subject
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 29 Jun 2016 14:14:46 +0000 (16:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Jun 2016 22:03:06 +0000 (15:03 -0700)
Just like we already taught the find_commit_subject() function (to make
it consistent with the code in pretty.c), we now simply skip leading
blank lines of the commit message.

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

index c4f4b7d..e286a6e 100644 (file)
@@ -568,10 +568,8 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
                 * information followed by "\n\n".
                 */
                p = strstr(msg.message, "\n\n");
-               if (p) {
-                       p += 2;
-                       strbuf_addstr(&msgbuf, p);
-               }
+               if (p)
+                       strbuf_addstr(&msgbuf, skip_blank_lines(p + 2));
 
                if (opts->record_origin) {
                        if (!has_conforming_footer(&msgbuf, NULL, 0))