]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ref-filter: export ref_kind_from_refname()
authorJustin Tobler <jltobler@gmail.com>
Tue, 21 Oct 2025 18:25:57 +0000 (13:25 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Oct 2025 21:40:37 +0000 (14:40 -0700)
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>
ref-filter.c
ref-filter.h

index 2cb5a166d61f09cac50909404538f75dd4ec012a..30cc488d8ab6595afe125bbdc252020b939b2334 100644 (file)
@@ -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;
 
index f22ca94b49df7c1b51fa02c7e931fc2b847ad1f0..4ed1edf09a256027a7757420d45a8a22570e2b80 100644 (file)
@@ -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