Re: [PATCH 08/17] provide a helper to free commit buffer

2014-06-12 Thread Junio C Hamano
Jeff King p...@peff.net writes: This converts two lines into one at each caller. But more importantly, it abstracts the concept of freeing the buffer, which will make it easier to change later. Note that we also need to provide a detach mechanism for the weird case in fsck which passes the

Re: [PATCH 08/17] provide a helper to free commit buffer

2014-06-12 Thread Jeff King
On Thu, Jun 12, 2014 at 11:22:31AM -0700, Junio C Hamano wrote: Note that we also need to provide a detach mechanism for the weird case in fsck which passes the buffer back to be freed. I find that last sentence a bit of white lie ;-). The sole caller of detach is in index-pack, and

Re: [PATCH 08/17] provide a helper to free commit buffer

2014-06-12 Thread Jeff King
On Thu, Jun 12, 2014 at 04:08:55PM -0400, Jeff King wrote: So just putting in the safety check is probably the least-disruptive thing. It doesn't automatically adapt to a change in the underlying commit_buffer code, but it would at least notice it. Here is that commit with the check you

[PATCH 08/17] provide a helper to free commit buffer

2014-06-10 Thread Jeff King
This converts two lines into one at each caller. But more importantly, it abstracts the concept of freeing the buffer, which will make it easier to change later. Note that we also need to provide a detach mechanism for the weird case in fsck which passes the buffer back to be freed.