Merge branch 'cc/ref-is-hidden-microcleanup' into maint
Code cleanup. * cc/ref-is-hidden-microcleanup: refs: use skip_prefix() in ref_is_hidden()
This commit is contained in:
commit
d0dffcacf3
9
refs.c
9
refs.c
@ -1160,7 +1160,7 @@ int ref_is_hidden(const char *refname, const char *refname_full)
|
|||||||
const char *match = hide_refs->items[i].string;
|
const char *match = hide_refs->items[i].string;
|
||||||
const char *subject;
|
const char *subject;
|
||||||
int neg = 0;
|
int neg = 0;
|
||||||
int len;
|
const char *p;
|
||||||
|
|
||||||
if (*match == '!') {
|
if (*match == '!') {
|
||||||
neg = 1;
|
neg = 1;
|
||||||
@ -1175,10 +1175,9 @@ int ref_is_hidden(const char *refname, const char *refname_full)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* refname can be NULL when namespaces are used. */
|
/* refname can be NULL when namespaces are used. */
|
||||||
if (!subject || !starts_with(subject, match))
|
if (subject &&
|
||||||
continue;
|
skip_prefix(subject, match, &p) &&
|
||||||
len = strlen(match);
|
(!*p || *p == '/'))
|
||||||
if (!subject[len] || subject[len] == '/')
|
|
||||||
return !neg;
|
return !neg;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user