Re: [PATCH 02/19] Allow fetch to modify refs

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

 



On Fri, 30 Oct 2009, Sverre Rabbelier wrote:

> Heya,
> 
> On Thu, Oct 29, 2009 at 22:56, Daniel Barkalow <barkalow@xxxxxxxxxxxx> wrote:
> >> +++ b/builtin-clone.c
> >> @@ -526,8 +526,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
> >>
> >>               refs = transport_get_remote_refs(transport);
> >>               if (refs) {
> >> -                     mapped_refs = wanted_peer_refs(refs, refspec);
> >> -                     transport_fetch_refs(transport, mapped_refs);
> >> +                     struct ref *ref_cpy = wanted_peer_refs(refs, refspec);
> >> +                     mapped_refs = ref_cpy;
> >> +                     transport_fetch_refs(transport, ref_cpy);
> >
> > Just drop this hunk; the change doesn't actually do anything. Otherwise,
> > the patch matches what I have.
> 
> Am I missing something? I thought we need this hunk since mapped_refs
> is const, and transport_fetch_refs takes a non-const argument?
> 
> builtin-clone.c: In function ‘cmd_clone’:
> builtin-clone.c:531: warning: passing argument 2 of
> ‘transport_fetch_refs’ discards qualifiers from pointer target type

Ah, actually, mapped_refs should just be made non-const; unlike "refs", 
it's set from wanted_peer_refs(), which returns a non-const value.

	-Daniel
*This .sig left intentionally blank*

[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]