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 <lfleischer@lfos.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Lukas Fleischer committed Nov 5, 2015 at 07:07 UTC 00b293e519d1aa0c5b57ae9359ec5306d7023b3f
1 file changed +3 -3
upload-pack.c
+3 -3
@@ -692,7 +692,7 @@ static int mark_our_ref(const char *refname, const struct object_id *oid)
692 {
693 struct object *o = lookup_unknown_object(oid->hash);
694
695 - if (ref_is_hidden(refname)) {
695 + if (refname && ref_is_hidden(refname)) {
696 o->flags |= HIDDEN_REF;
697 return 1;
698 }
@@ -703,7 +703,7 @@ static int mark_our_ref(const char *refname, const struct object_id *oid)
703 static int check_ref(const char *refname, const struct object_id *oid,
704 int flag, void *cb_data)
705 {
706 - mark_our_ref(refname, oid);
706 + mark_our_ref(strip_namespace(refname), oid);
707 return 0;
708 }
709
@@ -726,7 +726,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
726 const char *refname_nons = strip_namespace(refname);
727 struct object_id peeled;
728
729 - if (mark_our_ref(refname, oid))
729 + if (mark_our_ref(refname_nons, oid))
730 return 0;
731
732 if (capabilities) {