summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-17 19:47:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-12-17 19:47:18 (GMT)
commit14a9c5f261bcc436b80700076257f02af0beec68 (patch)
tree43f071ef531aaecba55cf73753711f89565aeb05 /builtin
parent433a30d0ba6e6d258be099859fa98d0205b25634 (diff)
parent1a72cfd7fa88e5a6c2b94568ac2fe69dfbd87f87 (diff)
downloadgit-14a9c5f261bcc436b80700076257f02af0beec68.zip
git-14a9c5f261bcc436b80700076257f02af0beec68.tar.gz
git-14a9c5f261bcc436b80700076257f02af0beec68.tar.bz2
Merge branch 'jl/commit-v-strip-marker'
"git commit -v" appends the patch to the log message before editing, and then removes the patch when the editor returned control. However, the patch was not stripped correctly when the first modified path was a submodule. * jl/commit-v-strip-marker: commit -v: strip diffs and submodule shortlogs from the commit message
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index e89c519..f4ff75d 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1505,7 +1505,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
struct strbuf sb = STRBUF_INIT;
struct strbuf author_ident = STRBUF_INIT;
const char *index_file, *reflog_msg;
- char *nl, *p;
+ char *nl;
unsigned char sha1[20];
struct ref_lock *ref_lock;
struct commit_list *parents = NULL, **pptr = &parents;
@@ -1601,11 +1601,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
}
/* Truncate the message just before the diff, if any. */
- if (verbose) {
- p = strstr(sb.buf, "\ndiff --git ");
- if (p != NULL)
- strbuf_setlen(&sb, p - sb.buf + 1);
- }
+ if (verbose)
+ wt_status_truncate_message_at_cut_line(&sb);
if (cleanup_mode != CLEANUP_NONE)
stripspace(&sb, cleanup_mode == CLEANUP_ALL);