Martin Ågren <martin.agren@xxxxxxxxx> 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 <schwab@xxxxxxxxxxxxxx> > Reviewed-by: Elijah Newren <newren@xxxxxxxxx> > Signed-off-by: Martin Ågren <martin.agren@xxxxxxxxx> > --- Makes sense. Thanks. Will queue.