Git development
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, 81625@debbugs.gnu.org,
	"Lester Longley" <lester@ieee.org>,
	"Sean Whitton" <spwhitton@spwhitton.name>,
	"Elijah Newren" <newren@gmail.com>,
	"Martin Ågren" <martin.agren@gmail.com>
Subject: Re: [PATCH] dir: skip excluded directory with nested repo on prefix match
Date: Sat, 26 Sep 2026 12:51:30 +0200	[thread overview]
Message-ID: <78937658-ac31-4ec9-8f8a-ce8fb74ed196@web.de> (raw)
In-Reply-To: <xmqqjyodj320.fsf@gitster.g>

On 9/22/26 6:57 AM, Junio C Hamano wrote:
> 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é


  reply	other threads:[~2026-09-26 10:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 13:31 [BUG] 'git status --ignored' <pathspec> matches partial names Sean Whitton
2026-09-15 15:54 ` René Scharfe
2026-09-18 11:04 ` [PATCH] dir: skip excluded directory with nested repo on prefix match René Scharfe
2026-09-22  4:57   ` Junio C Hamano
2026-09-26 10:51     ` René Scharfe [this message]
2026-09-26 10:48   ` [PATCH v2] " René Scharfe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78937658-ac31-4ec9-8f8a-ce8fb74ed196@web.de \
    --to=l.s.r@web.de \
    --cc=81625@debbugs.gnu.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lester@ieee.org \
    --cc=martin.agren@gmail.com \
    --cc=newren@gmail.com \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox