We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0869277 + 7a40a95 commit d0dffcaCopy full SHA for d0dffca
1 file changed
refs.c
@@ -1160,7 +1160,7 @@ int ref_is_hidden(const char *refname, const char *refname_full)
1160
const char *match = hide_refs->items[i].string;
1161
const char *subject;
1162
int neg = 0;
1163
- int len;
+ const char *p;
1164
1165
if (*match == '!') {
1166
neg = 1;
@@ -1175,10 +1175,9 @@ int ref_is_hidden(const char *refname, const char *refname_full)
1175
}
1176
1177
/* refname can be NULL when namespaces are used. */
1178
- if (!subject || !starts_with(subject, match))
1179
- continue;
1180
- len = strlen(match);
1181
- if (!subject[len] || subject[len] == '/')
+ if (subject &&
+ skip_prefix(subject, match, &p) &&
+ (!*p || *p == '/'))
1182
return !neg;
1183
1184
return 0;
0 commit comments