summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-05-26 22:27:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-26 22:47:20 (GMT)
commit8b8a53744f60274ef07e3a2a51995129c8d42f38 (patch)
tree003d6020e014d51269a9b299f5a829b70194227e /builtin/checkout.c
parent5b38456ec7bd0229bb35146ab8a905c4b63daeec (diff)
downloadgit-8b8a53744f60274ef07e3a2a51995129c8d42f38.zip
git-8b8a53744f60274ef07e3a2a51995129c8d42f38.tar.gz
git-8b8a53744f60274ef07e3a2a51995129c8d42f38.tar.bz2
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>
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 757f9a0..c1759dc 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);