summaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-12-02 23:47:25 -0800
committerJunio C Hamano <gitster@pobox.com>2008-12-02 23:47:25 -0800
commit2ab4de57ea2c423fe8abae5278507106972ef1fe (patch)
tree9828a4bdbebae0e83ec9d509b4192d8cdf7276d9 /builtin-commit.c
parent733070bea9ce28d557f0b0950acc05b3fe6ff6c6 (diff)
parent0b38227f283e208866d3e2ac85bcd947a71f1b17 (diff)
downloadgit-2ab4de57ea2c423fe8abae5278507106972ef1fe.tar.gz
Merge branch 'jk/maint-commit-v-strip' into maint
* 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 b563a0d67c..1e08399919 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -1004,9 +1004,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);