Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-11-26 18:16:08 +0300
committerJunio C Hamano <gitster@pobox.com>2007-11-26 20:14:49 +0300
commita98b819183820cf87f1073c36b57883cb05e7049 (patch)
treee49147fa4cc757b0b82bbdcd6f508553bfe8ce9a /builtin-commit.c
parent8babab95af7c01d9ea75c97ee0df40e5a2170b83 (diff)
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>
Diffstat (limited to 'builtin-commit.c')
-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)) {