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>
This commit is contained in:

committed by
Junio C Hamano

parent
88ef402f9c
commit
054a5aee6f
@ -103,7 +103,7 @@ static void print_new_head_line(struct commit *commit)
|
|||||||
if (body) {
|
if (body) {
|
||||||
const char *eol;
|
const char *eol;
|
||||||
size_t len;
|
size_t len;
|
||||||
body += 2;
|
body = skip_blank_lines(body + 2);
|
||||||
eol = strchr(body, '\n');
|
eol = strchr(body, '\n');
|
||||||
len = eol ? eol - body : strlen(body);
|
len = eol ? eol - body : strlen(body);
|
||||||
printf(" %.*s\n", (int) len, body);
|
printf(" %.*s\n", (int) len, body);
|
||||||
|
Reference in New Issue
Block a user