Skip to content

Commit 054a5ae

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 88ef402 commit 054a5ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static void print_new_head_line(struct commit *commit)
103103
if (body) {
104104
const char *eol;
105105
size_t len;
106-
body += 2;
106+
body = skip_blank_lines(body + 2);
107107
eol = strchr(body, '\n');
108108
len = eol ? eol - body : strlen(body);
109109
printf(" %.*s\n", (int) len, body);

0 commit comments

Comments
 (0)