Re: [PATCH] Fix premature free of ref_lists while writing temporary refs to file

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

 



On Wednesday 27 February 2008, Daniel Barkalow wrote:
> On Tue, 26 Feb 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?
> 
> Actually, it looks to me like the really right thing to do is tell 
> for_each_ref() to also include these refs temporarily, and not actually 
> write them to disk, read them back, and then delete them.

I completely agree.


...Johan


-- 
Johan Herland, <johan@xxxxxxxxxxx>
www.herland.net
-
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]

  Powered by Linux