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>
main
Justin Tobler 2025-10-21 13:25:57 -05:00 committed by Junio C Hamano
parent eafc03dbe3
commit 6d1997f6cb
2 changed files with 3 additions and 1 deletions

View File

@ -2833,7 +2833,7 @@ struct ref_array_item *ref_array_push(struct ref_array *array,
return ref; return ref;
} }


static int ref_kind_from_refname(const char *refname) int ref_kind_from_refname(const char *refname)
{ {
unsigned int i; unsigned int i;



View File

@ -135,6 +135,8 @@ struct ref_format {
OPT_STRVEC(0, "exclude", &(var)->exclude, \ OPT_STRVEC(0, "exclude", &(var)->exclude, \
N_("pattern"), N_("exclude refs which match pattern")) N_("pattern"), N_("exclude refs which match pattern"))


/* Get the reference kind from the provided reference name. */
int ref_kind_from_refname(const char *refname);
/* /*
* API for filtering a set of refs. Based on the type of refs the user * API for filtering a set of refs. Based on the type of refs the user
* has requested, we iterate through those refs and apply filters * has requested, we iterate through those refs and apply filters