Re: [PATCH 3/3] clone: always fetch remote HEAD
- From
Jeff King <peff@peff.net>
- Date
- Jun 7, 2011, 23:01 UTC
- Message-ID
- <20110607230013.GA23409@sigill.intra.peff.net>
- In-Reply-To
- <20110606220821.GB13697@sigill.intra.peff.net>
On Mon, Jun 06, 2011 at 06:08:21PM -0400, Jeff King wrote:
Show 20 quoted lines
> On Mon, Jun 06, 2011 at 01:31:54PM -0700, Junio C Hamano wrote:
>
> > > static struct ref *wanted_peer_refs(const struct ref *refs,
> > > struct refspec *refspec)
> > > {
> > > - struct ref *local_refs = NULL;
> > > - struct ref **tail = &local_refs;
> > > + struct ref *head = get_remote_ref(refs, "HEAD");
> >
> > The rest of the patch looked quite sane but I wonder if this should be
> > using get_remote_ref() that calls find_ref_by_name_abbrev() which in turn
> > would hit "refs/heads/HEAD" if the remote side didn't give you "HEAD".
> > Shouldn't it be using find_ref_by_name() directly?
>
> Ick, yeah, that was just me blindly cutting down what get_fetch_map was
> doing to the bit that I wanted, and thinking get_remote_ref was it. I
> didn't even notice the fact that it was using the _abbrev form of
> find_ref_by_name.
>
> It should definitely be an exact match. I'll fix it in my re-roll.OK, here is the re-roll. I've omitted the first two patches, which are the same as before. So this replaces the old 3/3. When merged with (or rebase on top of) the remote-helpers fixes I posted yesterday, all tests pass.
[1/2]: make copy_ref globally available [2/2]: clone: always fetch remote HEAD
-Peff