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:

committed by
Junio C Hamano

parent
5b38456ec7
commit
8b8a53744f
@ -1439,9 +1439,7 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
|
||||
|
||||
if (verbose) {
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
struct pretty_print_context ctx = {0};
|
||||
pretty_print_commit(CMIT_FMT_ONELINE, commit,
|
||||
&buf, &ctx);
|
||||
pp_commit_easy(CMIT_FMT_ONELINE, commit, &buf);
|
||||
printf("%c %s %s\n", sign,
|
||||
find_unique_abbrev(commit->object.sha1, abbrev),
|
||||
buf.buf);
|
||||
|
Reference in New Issue
Block a user