Skip to content

Commit

Permalink
send-pack: do not send out single-level refs such as refs/stash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
peff authored and gitster committed Nov 2, 2008
1 parent 1442171 commit 30affa1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion builtin-send-pack.c
Expand Up @@ -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);
Expand Down

0 comments on commit 30affa1

Please sign in to comment.