On Fri, Aug 23, 2013 at 1:36 AM, Junio C Hamano <gits...@pobox.com> wrote:
> Eric Sunshine <sunsh...@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.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to