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

Re: [PATCH] dir: skip excluded directory with nested repo on prefix match

From
René Scharfe <l.s.r@web.de>
Date
Sep 26, 2026, 10:51 UTC
Message-ID
<78937658-ac31-4ec9-8f8a-ce8fb74ed196@web.de>
In-Reply-To
<xmqqjyodj320.fsf@gitster.g>
On 9/22/26 6:57 AM, Junio C Hamano wrote:
Show 21 quoted lines
> René Scharfe <l.s.r@web.de> writes:
> 
>> @@ -2034,8 +2040,13 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
>>  		strbuf_release(&sb);
>>  
>>  		if (nested_repo) {
>> -			if ((dir->flags & DIR_SKIP_NESTED_GIT) ||
>> -				(matches_how == MATCHED_RECURSIVELY_LEADING_PATHSPEC))
>> +			if (dir->flags & DIR_SKIP_NESTED_GIT)
>> +				return path_none;
>> +			if (!matches_how)
>> +				matches_how = dir_match(istate, pathspec,
>> +							dirname, len);
>> +			if (!matches_how ||
>> +			    matches_how == MATCHED_RECURSIVELY_LEADING_PATHSPEC)
>>  				return path_none;
> 
> Here, we do not know if we have pathspec==NULL.  Shouldn't "make
> sure we have a result from dir_match() and return path_none as
> appropriate" be done only when pathspec != NULL or something like
> that, since dir_match() will crash if pathspec is NULL?
Ugh, nasty, that was silly of me.  Thanks for finding this bug!
René
Previous: Junio C HamanoNext: René Scharfe
Message 5 of 6 in “[BUG] 'git status --ignored' <pathspec> matches partial names”
  1. Sean WhittonSep 14, 2026
  2. René ScharfeSep 15, 2026
  3. dir: skip excluded directory with nested repo on prefix matchRené Scharfe, Sep 18, 2026
  4. Junio C HamanoSep 22, 2026
  5. René ScharfeSep 26, 2026
  6. dir: skip excluded directory with nested repo on prefix matchRené Scharfe, Sep 26, 2026

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.