diff options
author | Lukas Fleischer <lfleischer@lfos.de> | 2015-11-05 07:07:29 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-11-05 11:25:02 -0800 |
commit | 00b293e519d1aa0c5b57ae9359ec5306d7023b3f (patch) | |
tree | c47205c82f87910245cbd64fa9e0691937c5545e | |
parent | config.txt: document the semantics of hideRefs with namespaces (diff) | |
download | tgif-00b293e519d1aa0c5b57ae9359ec5306d7023b3f.tar.xz |
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>
-rw-r--r-- | upload-pack.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/upload-pack.c b/upload-pack.c index d0bc3ca07a..4ca960ec9d 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -692,7 +692,7 @@ static int mark_our_ref(const char *refname, const struct object_id *oid) { 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; } @@ -703,7 +703,7 @@ static int mark_our_ref(const char *refname, const struct object_id *oid) 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; } @@ -726,7 +726,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, oid)) return 0; if (capabilities) { |