Re: t3010 broken by 2eac2a4
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 23, 2013, 09:19 UTC
- Message-ID
- <CAPig+cRumXHk-30yvS8Q2xvOxA0qEEXaD7=iJo_X26HL-YRRJg@mail.gmail.com>
- In-Reply-To
- <7vsiy1j7dd.fsf@alter.siamese.dyndns.org>
On Fri, Aug 23, 2013 at 1:36 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes: > >> I sent a patch [1] which resolves the problem, although the solution >> is not especially pretty (due to some ugliness in the existing >> implementation). > > Yeah, thanks. > > I tend to agree with you that fixing the "icase" callee not to rely > on having the trailing slash (which is looking past the end of the > given string), instead of working that breakage around on the > caller's side like your patch did, would be a better alternative, > though.
My concern with fixing directory_exists_in_index_icase() to add the '/' itself was that it would have to copy the string to make space for the '/', which could be expensive. However, I reworked the code so that the existing strbufs now get passed to directory_exists_in_index_icase(), which allows it to add its needed '/' without duplicating the string. So, the trailing '/' requirement of directory_exists_in_index_icase() is now a private implementation detail, placing no burden on the caller.
I'll send the revised patch series later today since the commit message needs a rewrite. Also, I'd like to try to split the change into a couple patches -- one to pass around strbufs, which has a noisy diff, and one to fix the actual bug -- though I fear that splitting may not be possible.