From: Johan Herland Date: Tue, 26 Feb 2008 17:17:50 GMT Subject: Re: [PATCH] Fix premature free of ref_lists while writing temporary refs to file Message-ID: <200802261817.50673.johan@herland.net> In-Reply-To: On Tuesday 26 February 2008, Johannes Schindelin wrote: > Hi, > > On Tue, 26 Feb 2008, Johan Herland wrote: > > > We cannot call write_ref_sha1() from within a for_each_ref() callback, > > since it will free() the ref_list that the for_each_ref() is currently > > traversing. > > > > Therefore rewrite setup_tmp_ref() to not call write_ref_sha1(), as > > already hinted at in a comment. > > I guess the reason was to use a much of an API as possible. > > If you already avoid that, why not write into .git/packed-refs directly? That's exactly what I'm planning. ;-) ...just wanted to get the existing code working first. ...Johan -- Johan Herland, www.herland.net