Subject: Re: [RFC] git checkout $tree -- $path always rewrites files

From: Jeff King <[email-masked]>
Date: Thu, 13 Nov 2014 16:37:19 -0500

On Thu, Nov 13, 2014 at 01:18:43PM -0800, Junio C Hamano wrote:

> Jeff King <[email-masked]> writes:
> 
> > On Thu, Nov 13, 2014 at 02:26:55PM -0500, Jeff King wrote:
> >
> >> > Makes sense, including the use of strbuf (otherwise you would
> >> > allocate ce and then discard when it turns out that it is not
> >> > needed, which is probably with the same allocation pressure, but
> >> > looks uglier).
> >> 
> >> Exactly. Constructing it in ce->name does save you an allocation/memcpy
> >> in the case that we actually use the new entry, but I thought it would
> >> look weirder. It probably doesn't matter much either way, so I tried to
> >> write the most obvious thing.
> >
> > Actually, it is not that bad:
> 
> Yeah, actually it does look better; want me to squash it into the
> patch before queuing?

Yeah, if you like it, too, then let's go with it. Thanks.

-Peff