summaryrefslogtreecommitdiff
path: root/builtin/reset.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2016-06-29 14:14:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-06-29 22:03:36 (GMT)
commit054a5aee6f3e8e90d96f7b3f76f5f55752561c59 (patch)
tree8bd12b3a439f6135c4d4168d9a7897360263f6d6 /builtin/reset.c
parent88ef402f9c18dafee5c8b222200f8f984b17a73e (diff)
downloadgit-054a5aee6f3e8e90d96f7b3f76f5f55752561c59.zip
git-054a5aee6f3e8e90d96f7b3f76f5f55752561c59.tar.gz
git-054a5aee6f3e8e90d96f7b3f76f5f55752561c59.tar.bz2
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>
Diffstat (limited to 'builtin/reset.c')
-rw-r--r--builtin/reset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/reset.c b/builtin/reset.c
index 4c08ddc..34d8b23 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -103,7 +103,7 @@ static void print_new_head_line(struct commit *commit)
if (body) {
const char *eol;
size_t len;
- body += 2;
+ body = skip_blank_lines(body + 2);
eol = strchr(body, '\n');
len = eol ? eol - body : strlen(body);
printf(" %.*s\n", (int) len, body);