Re: error pushing stash ?
- From
Jeff King <peff@peff.net>
- Date
- Oct 28, 2008, 21:23 UTC
- Message-ID
- <20081028212327.GA25358@sigill.intra.peff.net>
- In-Reply-To
- <20081028211755.GA8074@sigill.intra.peff.net>
On Tue, Oct 28, 2008 at 05:17:55PM -0400, Jeff King wrote:
Show 7 quoted lines
> Since no version of receive-pack accepts these "funny refs", perhaps we > should mirror the check when considering the list of refs to send. IOW, > don't even make them eligible for matching or mirroring. Patch is below. > [...] > + /* we already know it starts with refs/ to get here */ > + if (check_ref_format(refname + 5)) > + return 0;
It occurs to me that since I didn't give a good commit message, and since I replied to a several-weeks-old message, this might be confusing. But what I am suggesting is that git-push should not bother trying to send something that it knows git-receive-pack will refuse. So this check goes into builtin-send-pack.c, and is an exact mirror of the one in builtin-receive-pack.c:
$ sed -n 177,181p builtin-receive-pack.c
/* only refs/... are allowed */
if (prefixcmp(name, "refs/") || check_ref_format(name + 5)) {
error("refusing to create funny ref '%s' remotely", name);
return "funny refname";
}-Peff