summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-06-22 22:20:20 +0200
committerJunio C Hamano <gitster@pobox.com>2016-06-22 13:24:17 -0700
commit4e1b06da252a7609f0c6641750e6acbec451e698 (patch)
tree4522faea1c57a8dcd9f0d8e4060e686245071a18 /commit.c
parent77356122443039b4b65a7795d66b3d1fdeedcce8 (diff)
downloadgit-4e1b06da252a7609f0c6641750e6acbec451e698.tar.gz
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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
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