summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-05-26 18:27:24 -0400
committerJunio C Hamano <gitster@pobox.com>2011-05-26 15:47:20 -0700
commit8b8a53744f60274ef07e3a2a51995129c8d42f38 (patch)
tree003d6020e014d51269a9b299f5a829b70194227e /pretty.c
parent5b38456ec7bd0229bb35146ab8a905c4b63daeec (diff)
downloadgit-8b8a53744f60274ef07e3a2a51995129c8d42f38.tar.gz
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 'pretty.c')
-rw-r--r--pretty.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index 305ff85d74..75a9a416a4 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1288,3 +1288,10 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
free(reencoded);
}
+
+void pp_commit_easy(enum cmit_fmt fmt, const struct commit *commit,
+ struct strbuf *sb)
+{
+ struct pretty_print_context pp = {0};
+ pretty_print_commit(fmt, commit, sb, &pp);
+}