if (!o)
return PEEL_INVALID;
- hashcpy(sha1, o->sha1);
+ hashcpy(sha1, o->oid.hash);
return PEEL_PEELED;
}
return 0;
}
-int ref_is_hidden(const char *refname)
+int ref_is_hidden(const char *refname, const char *refname_full)
{
int i;
return 0;
for (i = hide_refs->nr - 1; i >= 0; i--) {
const char *match = hide_refs->items[i].string;
+ const char *subject;
int neg = 0;
int len;
match++;
}
- if (!starts_with(refname, match))
+ if (*match == '^') {
+ subject = refname_full;
+ match++;
+ } else {
+ subject = refname;
+ }
+
+ /* refname can be NULL when namespaces are used. */
+ if (!subject || !starts_with(subject, match))
continue;
len = strlen(match);
- if (!refname[len] || refname[len] == '/')
+ if (!subject[len] || subject[len] == '/')
return !neg;
}
return 0;