From: Johannes Schindelin Date: Sat, 18 Jun 2016 13:12:17 GMT Subject: [PATCH] Make find_commit_subject() more robust Message-ID: <34ef85eb4e2aef0b342ef5d3bce9e468c8339486.1466255489.git.johannes.schindelin@gmx.de> Just like the pretty printing machinery, we should simply ignore empty lines at the beginning of the commit messages. This discrepancy was noticed when an early version of the rebase--helper produced commit objects with more than one empty line between the header and the commit message. Signed-off-by: Johannes Schindelin --- Published-As: https://github.com/dscho/git/releases/tag/leading-empty-lines-v1 Aaaaand another patch from the rebase--helper front. I guess I'll call it a day with this one. commit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commit.c b/commit.c index 3f4f371..7b00989 100644 --- a/commit.c +++ b/commit.c @@ -415,6 +415,8 @@ int find_commit_subject(const char *commit_buffer, const char **subject) p++; if (*p) { p += 2; + while (*p == '\n') + p++; for (eol = p; *eol && *eol != '\n'; eol++) ; /* do nothing */ } else -- 2.9.0.119.gb7b8d21 base-commit: 05219a1276341e72d8082d76b7f5ed394b7437a4