pretty: add pp_commit_easy function for simple callers

Many callers don't actually care about the pretty print
context at all; let's just give them a simple way of
pretty-printing a commit without having to create a context
struct.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2011-05-26 18:27:24 -04:00
committed by Junio C Hamano
parent 5b38456ec7
commit 8b8a53744f
7 changed files with 14 additions and 12 deletions

View File

@ -436,9 +436,7 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
commit = item->commit;
if (commit && !parse_commit(commit)) {
struct pretty_print_context ctx = {0};
pretty_print_commit(CMIT_FMT_ONELINE, commit,
&subject, &ctx);
pp_commit_easy(CMIT_FMT_ONELINE, commit, &subject);
sub = subject.buf;
}