aboutsummaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-11-20 06:56:11 -0500
committerJeff King <peff@peff.net>2015-11-20 06:56:11 -0500
commitdbba85e46b9c7450710a23208ca1868179330e1e (patch)
tree1de2e7302f6872f263e187859b2917ad13f826a4 /upload-pack.c
parent45014beac004a610938a265698605c18ab126087 (diff)
parent948bfa2c0f40a97d670c6a3fc22c05ceb2ec2c3f (diff)
downloadgit-dbba85e46b9c7450710a23208ca1868179330e1e.tar.gz
git-dbba85e46b9c7450710a23208ca1868179330e1e.tar.xz
Merge branch 'lf/ref-is-hidden-namespace'
Extend transfer.hideRefs to work better with use of namespaces. * lf/ref-is-hidden-namespace: t5509: add basic tests for hideRefs hideRefs: add support for matching full refs upload-pack: strip refs before calling ref_is_hidden() config.txt: document the semantics of hideRefs with namespaces
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/upload-pack.c b/upload-pack.c
index d0bc3ca07..08efb1de7 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -688,11 +688,12 @@ static void receive_needs(void)
}
/* return non-zero if the ref is hidden, otherwise 0 */
-static int mark_our_ref(const char *refname, const struct object_id *oid)
+static int mark_our_ref(const char *refname, const char *refname_full,
+ const struct object_id *oid)
{
struct object *o = lookup_unknown_object(oid->hash);
- if (ref_is_hidden(refname)) {
+ if (ref_is_hidden(refname, refname_full)) {
o->flags |= HIDDEN_REF;
return 1;
}
@@ -700,10 +701,12 @@ static int mark_our_ref(const char *refname, const struct object_id *oid)
return 0;
}
-static int check_ref(const char *refname, const struct object_id *oid,
+static int check_ref(const char *refname_full, const struct object_id *oid,
int flag, void *cb_data)
{
- mark_our_ref(refname, oid);
+ const char *refname = strip_namespace(refname_full);
+
+ mark_our_ref(refname, refname_full, oid);
return 0;
}
@@ -726,7 +729,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
const char *refname_nons = strip_namespace(refname);
struct object_id peeled;
- if (mark_our_ref(refname, oid))
+ if (mark_our_ref(refname_nons, refname, oid))
return 0;
if (capabilities) {