mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
Fix off-by-one error when truncating the diff out of the commit message.
Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
8babab95af
commit
a98b819183
@ -765,7 +765,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
|
||||
/* Truncate the message just before the diff, if any. */
|
||||
p = strstr(sb.buf, "\ndiff --git a/");
|
||||
if (p != NULL)
|
||||
strbuf_setlen(&sb, p - sb.buf);
|
||||
strbuf_setlen(&sb, p - sb.buf + 1);
|
||||
|
||||
stripspace(&sb, 1);
|
||||
if (sb.len < header_len || message_is_empty(&sb, header_len)) {
|
||||
|
Loading…
Reference in New Issue
Block a user