Make hideRefs handling in upload-pack consistent with the behavior
described in the documentation by stripping refs before comparing them
with prefixes in hideRefs.
Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
{
struct object *o = lookup_unknown_object(oid->hash);
- if (ref_is_hidden(refname)) {
+ if (refname && ref_is_hidden(refname)) {
o->flags |= HIDDEN_REF;
return 1;
}
static int check_ref(const char *refname, const struct object_id *oid,
int flag, void *cb_data)
{
- mark_our_ref(refname, oid);
+ mark_our_ref(strip_namespace(refname), oid);
return 0;
}
const char *refname_nons = strip_namespace(refname);
struct object_id peeled;
- if (mark_our_ref(refname, oid))
+ if (mark_our_ref(refname_nons, oid))
return 0;
if (capabilities) {