summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--refs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/refs.c b/refs.c
index 2d717742d6..dcfa4dee7a 100644
--- a/refs.c
+++ b/refs.c
@@ -1066,7 +1066,7 @@ int ref_is_hidden(const char *refname, const char *refname_full)
const char *match = hide_refs->items[i].string;
const char *subject;
int neg = 0;
- int len;
+ const char *p;
if (*match == '!') {
neg = 1;
@@ -1081,10 +1081,9 @@ int ref_is_hidden(const char *refname, const char *refname_full)
}
/* refname can be NULL when namespaces are used. */
- if (!subject || !starts_with(subject, match))
- continue;
- len = strlen(match);
- if (!subject[len] || subject[len] == '/')
+ if (subject &&
+ skip_prefix(subject, match, &p) &&
+ (!*p || *p == '/'))
return !neg;
}
return 0;