Re: Git in next is broken
- From
Nicolas Pitre <nico@fluxnic.net>
- Date
- Nov 13, 2009, 16:54 UTC
- Message-ID
- <alpine.LFD.2.00.0911131152120.16711@xanadu.home>
- In-Reply-To
- <alpine.LNX.2.00.0911130910150.17726@reaper.quantumfyre.co.uk>
On Fri, 13 Nov 2009, Julian Phillips wrote:
Show 23 quoted lines
> On Thu, 12 Nov 2009, Nicolas Pitre wrote: > > > Without the "ref_map = next" there is no change: glibc still complains > > about corruption and abort the execution. With the "ref_map = next" > > then git simply segfaults. > > I was half right about "ref_map = next", I had forgotten about setting prev in > the for(...). For me, the following fixes it on MacOS (I don't have time to > test on Linux right now): > > diff --git a/remote.c b/remote.c > index 4f9f0cc..6195a58 100644 > --- a/remote.c > +++ b/remote.c > @@ -754,6 +754,8 @@ void ref_remove_duplicates(struct ref *ref_map) > prev->next = ref_map->next; > free(ref_map->peer_ref); > free(ref_map); > + ref_map = prev; // Keep the same prev. > + continue; > } > > item = string_list_insert(ref_map->peer_ref->name, &refs);
Yep, this fixes it for me on Linux too. Please resend to Junio with my ACK.
Nicolas