diff options
author | Jeff King <peff@peff.net> | 2008-10-29 08:17:55 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-02 09:48:39 +0300 |
commit | 30affa1e9a15e848f77c9c14544dd6dd593559d5 (patch) | |
tree | 88582765056b932f4ea9bb9cd93464cb7cf29830 /builtin-send-pack.c | |
parent | 1442171bc913a9cddae5c6ad0d0a4be3a1ca86e8 (diff) |
send-pack: do not send out single-level refs such as refs/stash
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>
Diffstat (limited to 'builtin-send-pack.c')
-rw-r--r-- | builtin-send-pack.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin-send-pack.c b/builtin-send-pack.c index 2af9f293414..301f2304326 100644 --- a/builtin-send-pack.c +++ b/builtin-send-pack.c @@ -132,7 +132,13 @@ static struct ref *remote_refs, **remote_tail; 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); |