Merge branch 'jk/maint-commit-v-strip'

* jk/maint-commit-v-strip:
  commit: Fix stripping of patch in verbose mode.
This commit is contained in:
Junio C Hamano
2008-11-12 22:26:56 -08:00
2 changed files with 78 additions and 3 deletions

View File

@ -1015,9 +1015,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);