From 8b8a53744f60274ef07e3a2a51995129c8d42f38 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 26 May 2011 18:27:24 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- builtin/checkout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'builtin/checkout.c') diff --git a/builtin/checkout.c b/builtin/checkout.c index 757f9a08dd..c1759dc3a4 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -300,9 +300,8 @@ static void show_local_changes(struct object *head, struct diff_options *opts) static void describe_detached_head(char *msg, struct commit *commit) { struct strbuf sb = STRBUF_INIT; - struct pretty_print_context ctx = {0}; parse_commit(commit); - pretty_print_commit(CMIT_FMT_ONELINE, commit, &sb, &ctx); + pp_commit_easy(CMIT_FMT_ONELINE, commit, &sb); fprintf(stderr, "%s %s... %s\n", msg, find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV), sb.buf); strbuf_release(&sb); -- cgit v1.2.3