summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1442171)
raw | patch | inline | side by side (parent: 1442171)
author | Jeff King <peff@peff.net> | |
Wed, 29 Oct 2008 05:17:55 +0000 (05:17 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 2 Nov 2008 06:48:39 +0000 (23:48 -0700) |
Since no version of receive-pack accepts these "funny refs", we should
mirror the check when considering the list of refs to send. IOW, don't
even make them eligible for matching or mirroring.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mirror the check when considering the list of refs to send. IOW, don't
even make them eligible for matching or mirroring.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-send-pack.c | patch | blob | history |
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 2af9f2934142f55858f4b5c76deb6397ac74b9f8..301f23043262059dcb28994527334ba1909671f0 100644 (file)
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
static int one_local_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
{
struct ref *ref;
- int len = strlen(refname) + 1;
+ int len;
+
+ /* we already know it starts with refs/ to get here */
+ if (check_ref_format(refname + 5))
+ return 0;
+
+ len = strlen(refname) + 1;
ref = xcalloc(1, sizeof(*ref) + len);
hashcpy(ref->new_sha1, sha1);
memcpy(ref->name, refname, len);