Merge branch 'tc/commit-abbrev-fix' into maint

* tc/commit-abbrev-fix:
  commit::print_summary(): don't use format_commit_message()
  t7502-commit: add summary output tests for empty and merge commits
  t7502-commit: add tests for summary output
This commit is contained in:
Junio C Hamano
2010-06-22 09:31:47 -07:00
2 changed files with 72 additions and 6 deletions

View File

@ -1153,13 +1153,11 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
initial_commit ? " (root-commit)" : "");
if (!log_tree_commit(&rev, commit)) {
struct pretty_print_context ctx = {0};
struct strbuf buf = STRBUF_INIT;
ctx.date_mode = DATE_NORMAL;
format_commit_message(commit, format.buf + 7, &buf, &ctx);
printf("%s\n", buf.buf);
strbuf_release(&buf);
rev.always_show_header = 1;
rev.use_terminator = 1;
log_tree_commit(&rev, commit);
}
strbuf_release(&format);
}