diff options
author | Kristian Høgsberg <krh@redhat.com> | 2007-11-26 10:16:08 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-11-26 09:14:49 -0800 |
commit | a98b819183820cf87f1073c36b57883cb05e7049 (patch) | |
tree | e49147fa4cc757b0b82bbdcd6f508553bfe8ce9a | |
parent | builtin-commit.c: export GIT_INDEX_FILE for launch_editor as well. (diff) | |
download | tgif-a98b819183820cf87f1073c36b57883cb05e7049.tar.xz |
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>
-rw-r--r-- | builtin-commit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-commit.c b/builtin-commit.c index f60bd7f4dc..a35881e20b 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -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)) { |