@@ -1388,14 +1388,14 @@ int parse_hide_refs_config(const char *var, const char *value, const char *secti
return 0;
}
-int ref_is_hidden(const char *refname, const char *refname_full)
+int ref_matches(struct string_list *match_refs, const char *refname, const char *refname_full)
{
int i;
- if (!hide_refs)
+ if (!match_refs)
return 0;
- for (i = hide_refs->nr - 1; i >= 0; i--) {
- const char *match = hide_refs->items[i].string;
+ for (i = match_refs->nr - 1; i >= 0; i--) {
+ const char *match = match_refs->items[i].string;
const char *subject;
int neg = 0;
const char *p;
@@ -1421,6 +1421,11 @@ int ref_is_hidden(const char *refname, const char *refname_full)
return 0;
}
+int ref_is_hidden(const char *refname, const char *refname_full)
+{
+ return ref_matches(hide_refs, refname, refname_full);
+}
+
const char *find_descendant_ref(const char *dirname,
const struct string_list *extras,
const struct string_list *skip)
@@ -739,6 +739,7 @@ int parse_hide_refs_config(const char *var, const char *value, const char *);
* parameter always points to the full ref name.
*/
int ref_is_hidden(const char *, const char *);
+int ref_matches(struct string_list *, const char *, const char *);
enum ref_type {
REF_TYPE_PER_WORKTREE, /* refs inside refs/ but not shared */