Skip to content

Commit 00b293e

Browse files
lfosgitster
authored andcommitted
upload-pack: strip refs before calling ref_is_hidden()
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92cab49 commit 00b293e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

upload-pack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ static int mark_our_ref(const char *refname, const struct object_id *oid)
692692
{
693693
struct object *o = lookup_unknown_object(oid->hash);
694694

695-
if (ref_is_hidden(refname)) {
695+
if (refname && ref_is_hidden(refname)) {
696696
o->flags |= HIDDEN_REF;
697697
return 1;
698698
}
@@ -703,7 +703,7 @@ static int mark_our_ref(const char *refname, const struct object_id *oid)
703703
static int check_ref(const char *refname, const struct object_id *oid,
704704
int flag, void *cb_data)
705705
{
706-
mark_our_ref(refname, oid);
706+
mark_our_ref(strip_namespace(refname), oid);
707707
return 0;
708708
}
709709

@@ -726,7 +726,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
726726
const char *refname_nons = strip_namespace(refname);
727727
struct object_id peeled;
728728

729-
if (mark_our_ref(refname, oid))
729+
if (mark_our_ref(refname_nons, oid))
730730
return 0;
731731

732732
if (capabilities) {

0 commit comments

Comments
 (0)