summaryrefslogtreecommitdiff
path: root/ref-filter.h
diff options
context:
space:
mode:
authorLukas Puehringer <luk.puehringer@gmail.com>2017-01-17 23:37:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-18 00:10:22 (GMT)
commit2111aa794bb420f767895682232b494d3461ab31 (patch)
tree4d3c95589c1045888eb23de32d43ba2a06e6605b /ref-filter.h
parent94240b918f70560393516aa8f98edb877d582c69 (diff)
downloadgit-2111aa794bb420f767895682232b494d3461ab31.zip
git-2111aa794bb420f767895682232b494d3461ab31.tar.gz
git-2111aa794bb420f767895682232b494d3461ab31.tar.bz2
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 <luk.puehringer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.h')
-rw-r--r--ref-filter.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ref-filter.h b/ref-filter.h
index 14d435e..3cf3d3f 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 */