aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-02-05 14:01:09 -0800
committerJunio C Hamano <gitster@pobox.com>2014-02-05 14:01:09 -0800
commita118beeddf9d0373078595dd1d1d5f33441a1cdd (patch)
treed4befbf13141706b88aded2f329d388c7084c731 /builtin
parentac0835f94bdfd24ebfe228b2f6ace48416223dfd (diff)
parent1a72cfd7fa88e5a6c2b94568ac2fe69dfbd87f87 (diff)
downloadgit-a118beeddf9d0373078595dd1d1d5f33441a1cdd.tar.gz
git-a118beeddf9d0373078595dd1d1d5f33441a1cdd.tar.xz
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.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 6ab4605cf..fedb45af8 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);