reset --hard: skip blank lines when reporting the commit subject

When there are blank lines at the beginning of a commit message, the pretty printing machinery already skips them when showing a commit subject (or the complete commit message). We shall henceforth do the same when reporting the commit subject after the user called git reset --hard <commit> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jun 29, 2016 at 16:14 UTC 054a5aee6f3e8e90d96f7b3f76f5f55752561c59
1 file changed +1 -1
builtin/reset.c
+1 -1
@@ -103,7 +103,7 @@ static void print_new_head_line(struct commit *commit)
103 if (body) {
104 const char *eol;
105 size_t len;
106 - body += 2;
106 + body = skip_blank_lines(body + 2);
107 eol = strchr(body, '\n');
108 len = eol ? eol - body : strlen(body);
109 printf(" %.*s\n", (int) len, body);