ref-filter: export ref_kind_from_refname()

When filtering refs, `ref_kind_from_refname()` is used to determine the ref type. In a subsequent commit, this same logic is reused when counting refs by type. Export the function to prepare for this change. Signed-off-by: Justin Tobler <jltobler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Justin Tobler committed Oct 21, 2025 at 13:25 UTC 6d1997f6cbc10ac03bc450630de4410762f77b6f
2 files changed +3 -1
ref-filter.c
+1 -1
@@ -2833,7 +2833,7 @@ struct ref_array_item *ref_array_push(struct ref_array *array,
2833 return ref;
2834 }
2835
2836 -static int ref_kind_from_refname(const char *refname)
2836 +int ref_kind_from_refname(const char *refname)
2837 {
2838 unsigned int i;
2839
ref-filter.h
+2
@@ -135,6 +135,8 @@ struct ref_format {
135 OPT_STRVEC(0, "exclude", &(var)->exclude, \
136 N_("pattern"), N_("exclude refs which match pattern"))
137
138 +/* Get the reference kind from the provided reference name. */
139 +int ref_kind_from_refname(const char *refname);
140 /*
141 * API for filtering a set of refs. Based on the type of refs the user
142 * has requested, we iterate through those refs and apply filters