diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-02-06 02:01:09 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-06 02:01:09 +0400 |
commit | a118beeddf9d0373078595dd1d1d5f33441a1cdd (patch) | |
tree | d4befbf13141706b88aded2f329d388c7084c731 /builtin | |
parent | ac0835f94bdfd24ebfe228b2f6ace48416223dfd (diff) | |
parent | 1a72cfd7fa88e5a6c2b94568ac2fe69dfbd87f87 (diff) |
Merge branch 'jl/commit-v-strip-marker' into maint
"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.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 6ab4605cf5..fedb45af8c 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); |