Re: [PATCH 3/3] clone: always fetch remote HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 06, 2011 at 06:08:21PM -0400, Jeff King wrote:

> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]