summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Kristian Høgsberg <krh@redhat.com>2007-11-26 10:16:08 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-11-26 09:14:49 -0800
commita98b819183820cf87f1073c36b57883cb05e7049 (patch)
treee49147fa4cc757b0b82bbdcd6f508553bfe8ce9a
parentbuiltin-commit.c: export GIT_INDEX_FILE for launch_editor as well. (diff)
downloadtgif-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.c2
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)) {