git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] dir: test_one_path: fix inconsistent behavior due to missing '/'

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 25, 2013, 08:05 UTC
Message-ID
<CAPig+cSY8oMeAaS2GRaPhwCkfO=eLa6-UPcJGRe98c0uUFbm8Q@mail.gmail.com>
In-Reply-To
<20130825060045.GP2882@elie.Belkin>
On Sun, Aug 25, 2013 at 2:00 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 11 quoted lines
> Eric Sunshine wrote:
>
>> Although undocumented, directory_exists_in_index_icase(dirname,len)
>> unconditionally assumes the presence of a '/' at dirname[len] (despite
>> being past the end-of-string). Callers are expected to respect
> [...]
>>                                                Fix this problem.
>
> So, does this fix the problem by changing
> directory_exists_in_index_icase() to be more liberal in what it
> accepts, or callers to be more conservative in what they pass in?

It places the onus upon the caller. As mentioned in the cover letter [1], I was not happy with this solution. Junio felt likewise. A follow-up series [2] fixes both directory_exists_in_index() and directory_exists_in_index_icase() to be more liberal in what they accept, relieving the caller of the burden. By the time that series was posted, however, Junio and Peff had decided that a fix at a more fundamental level would be better (a conclusion with which I agree, but for which I do not yet have sufficient knowledge about git internals to implement). In the meantime, as an interim bug fix, Junio decided [3] to apply the patch to which you responded (but with an updated commit message).

[1]: http://thread.gmane.org/gmane.comp.version-control.git/232796 [2]: http://thread.gmane.org/gmane.comp.version-control.git/232833 [3]: http://thread.gmane.org/gmane.comp.version-control.git/232833/focus=232837

> Please forgive my laziness.  I ask in order to save future readers the
> time of digging into the code.
Previous: Jonathan NiederNext: Junio C Hamano
Message 6 of 7 in “fix t3010 failure when core.ignorecase=true”
  1. 0/2 fix t3010 failure when core.ignorecase=trueEric Sunshine, Aug 23, 2013
  2. 1/2 t3103: demonstrate dir.c:treat_one_path() core.ignorecase failureEric Sunshine, Aug 23, 2013
  3. Junio C HamanoAug 23, 2013
  4. 2/2 dir: test_one_path: fix inconsistent behavior due to missing '/'Eric Sunshine, Aug 23, 2013
  5. Jonathan NiederAug 25, 2013
  6. Eric SunshineAug 25, 2013
  7. Junio C HamanoAug 26, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.