Jeff King <p...@peff.net> writes:
> To be honest, I don't know. Most of dir.c predates me, and I've tried to
> avoid looking at it too hard. But I had a vague recollection of it being
> "best effort", and this bit from cf424f5fd89b reinforces that:
> However, read_directory does not actually check against our pathspec.
> It uses a simplified version that may turn up false positives. As a
> result, we need to check that any hits match our pathspec.
At least the original design of the traversal was "try making use of
pathspec during the traversal when we can cheaply filter out obvious
non-hits and avoid recursing into an entire hierarchy---false negative
is an absolute no-no, but forcing the consumer to post filter is OK".
> ... But I think that anybody who looks at the output of
> fill_directory() does need to be aware that they may get more entries
> than they expected, and has to apply the pathspecs themselves.
That matches with my understanding of how "fill" thing worked from