[PATCH v6 3/7] ref-filter: export ref_kind_from_refname()
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Oct 21, 2025, 18:25 UTC
- Message-ID
- <20251021182601.2687284-4-jltobler@gmail.com>
- In-Reply-To
- <20251021182601.2687284-1-jltobler@gmail.com>
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> --- ref-filter.c | 2 +- ref-filter.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/ref-filter.c b/ref-filter.c index 2cb5a166d6..30cc488d8a 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -2833,7 +2833,7 @@ struct ref_array_item *ref_array_push(struct ref_array *array, return ref; } -static int ref_kind_from_refname(const char *refname) +int ref_kind_from_refname(const char *refname) { unsigned int i; diff --git a/ref-filter.h b/ref-filter.h index f22ca94b49..4ed1edf09a 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -135,6 +135,8 @@ struct ref_format { OPT_STRVEC(0, "exclude", &(var)->exclude, \ 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 * has requested, we iterate through those refs and apply filters
-- 2.51.0.193.g4975ec3473b