summaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-12 22:26:56 -0800
committerJunio C Hamano <gitster@pobox.com>2008-11-12 22:26:56 -0800
commit6d14414d21973580547ca1935b2692a43c0b0b5f (patch)
treec2ba9b3fb9c2b7065de12edd72986158df000ae8 /builtin-commit.c
parent7b51b77dbc71e83789f59f0cd559489115478f27 (diff)
parent0b38227f283e208866d3e2ac85bcd947a71f1b17 (diff)
downloadgit-6d14414d21973580547ca1935b2692a43c0b0b5f.tar.gz
Merge branch 'jk/maint-commit-v-strip'
* jk/maint-commit-v-strip: commit: Fix stripping of patch in verbose mode.
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index 93ca496357..591d16b91e 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -1015,9 +1015,11 @@ 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 + 1);
+ if (verbose) {
+ p = strstr(sb.buf, "\ndiff --git ");
+ if (p != NULL)
+ strbuf_setlen(&sb, p - sb.buf + 1);
+ }
if (cleanup_mode != CLEANUP_NONE)
stripspace(&sb, cleanup_mode == CLEANUP_ALL);