diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-28 11:25:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-28 11:25:50 -0700 |
commit | 4966b58f3e1f295e3fb22560006b1db717b56f37 (patch) | |
tree | af3813c17a7bc43822bd9d7b0b6ca008eeff8789 /builtin | |
parent | 053e2fb5798374d1628b8cd4d797a64e48c944b6 (diff) | |
parent | 054a5aee6f3e8e90d96f7b3f76f5f55752561c59 (diff) | |
download | git-4966b58f3e1f295e3fb22560006b1db717b56f37.tar.gz |
Merge branch 'js/find-commit-subject-ignore-leading-blanks' into maint
A helper function that takes the contents of a commit object and
finds its subject line did not ignore leading blank lines, as is
commonly done by other codepaths. Make it ignore leading blank
lines to match.
* js/find-commit-subject-ignore-leading-blanks:
reset --hard: skip blank lines when reporting the commit subject
sequencer: use skip_blank_lines() to find the commit subject
commit -C: skip blank lines at the beginning of the message
commit.c: make find_commit_subject() more robust
pretty: make the skip_blank_lines() function public
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/commit.c | 2 | ||||
-rw-r--r-- | builtin/reset.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 163dbcabf3..37702f3561 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -714,7 +714,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, char *buffer; buffer = strstr(use_message_buffer, "\n\n"); if (buffer) - strbuf_addstr(&sb, buffer + 2); + strbuf_addstr(&sb, skip_blank_lines(buffer + 2)); hook_arg1 = "commit"; hook_arg2 = use_message; } else if (fixup_message) { diff --git a/builtin/reset.c b/builtin/reset.c index 092c3a5399..e8c5767030 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); |