From: Junio C Hamano Date: Mon, 20 Jul 2020 20:25:49 GMT Subject: Re: [PATCH] dir: check pathspecs before returning `path_excluded` Message-ID: In-Reply-To: <20200720184529.22449-1-martin.agren@gmail.com> Martin Ågren writes: > In 95c11ecc73 ("Fix error-prone fill_directory() API; make it only > return matches", 2020-04-01), we taught `fill_directory()`, or more > specifically `treat_path()`, to check against any pathspecs so that we > could simplify the callers. > > But in doing so, we added a slightly-to-early return for the "excluded" > case. We end up not checking the pathspecs, meaning we return > `path_excluded` when maybe we should return `path_none`. As a result, > `git status --ignored -- pathspec` might show paths that don't actually > match "pathspec". > > Move the "excluded" check down to after we've checked any pathspecs. > > Reported-by: Andreas Schwab > Reviewed-by: Elijah Newren > Signed-off-by: Martin Ågren > --- Makes sense. Thanks. Will queue.