Skip to content

Commit 6d1997f

Browse files
jltoblergitster
authored andcommitted
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>
1 parent eafc03d commit 6d1997f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ref-filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2833,7 +2833,7 @@ struct ref_array_item *ref_array_push(struct ref_array *array,
28332833
return ref;
28342834
}
28352835

2836-
static int ref_kind_from_refname(const char *refname)
2836+
int ref_kind_from_refname(const char *refname)
28372837
{
28382838
unsigned int i;
28392839

ref-filter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ struct ref_format {
135135
OPT_STRVEC(0, "exclude", &(var)->exclude, \
136136
N_("pattern"), N_("exclude refs which match pattern"))
137137

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

0 commit comments

Comments
 (0)