From 4e1b06da252a7609f0c6641750e6acbec451e698 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 22 Jun 2016 22:20:20 +0200 Subject: commit.c: make find_commit_subject() more robust Just like the pretty printing machinery, we should simply ignore blank 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 Signed-off-by: Junio C Hamano --- commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commit.c') diff --git a/commit.c b/commit.c index 0eee410764..116774c210 100644 --- a/commit.c +++ b/commit.c @@ -398,7 +398,7 @@ int find_commit_subject(const char *commit_buffer, const char **subject) while (*p && (*p != '\n' || p[1] != '\n')) p++; if (*p) { - p += 2; + p = skip_blank_lines(p + 2); for (eol = p; *eol && *eol != '\n'; eol++) ; /* do nothing */ } else -- cgit v1.2.3