diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-12-17 11:47:18 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-17 11:47:18 -0800 |
commit | 14a9c5f261bcc436b80700076257f02af0beec68 (patch) | |
tree | 43f071ef531aaecba55cf73753711f89565aeb05 /builtin/commit.c | |
parent | 433a30d0ba6e6d258be099859fa98d0205b25634 (diff) | |
parent | 1a72cfd7fa88e5a6c2b94568ac2fe69dfbd87f87 (diff) | |
download | git-14a9c5f261bcc436b80700076257f02af0beec68.tar.gz |
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/commit.c')
-rw-r--r-- | builtin/commit.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index e89c519192..f4ff75d684 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); |