From 2111aa794bb420f767895682232b494d3461ab31 Mon Sep 17 00:00:00 2001 From: Lukas Puehringer Date: Tue, 17 Jan 2017 18:37:19 -0500 Subject: ref-filter: add function to print single ref_array_item ref-filter functions are useful for printing git object information using a format specifier. However, some other modules may not want to use this functionality on a ref-array but only print a single item. Expose a pretty_print_ref function to create, pretty print and free individual ref-items. Signed-off-by: Lukas Puehringer Signed-off-by: Junio C Hamano --- ref-filter.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ref-filter.h') diff --git a/ref-filter.h b/ref-filter.h index 14d435e2cc..3cf3d3f590 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -107,4 +107,11 @@ struct ref_sorting *ref_default_sorting(void); /* Function to parse --merged and --no-merged options */ int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset); +/* + * Print a single ref, outside of any ref-filter. Note that the + * name must be a fully qualified refname. + */ +void pretty_print_ref(const char *name, const unsigned char *sha1, + const char *format); + #endif /* REF_FILTER_H */ -- cgit v1.2.3