diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2007-10-19 10:59:22 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-10-21 01:44:40 -0400 |
commit | 07134421fc5765d6c96c548e70e461c290143762 (patch) | |
tree | d6aa5c5143a710d756670069d38baee75ec0dd6d /builtin-prune-packed.c | |
parent | Merge branch 'maint' of git://repo.or.cz/git-gui into maint (diff) | |
download | tgif-07134421fc5765d6c96c548e70e461c290143762.tar.xz |
Fix directory scanner to correctly ignore files without d_type
On Fri, 19 Oct 2007, Todd T. Fries wrote:
> If DT_UNKNOWN exists, then we have to do a stat() of some form to
> find out the right type.
That happened in the case of a pathname that was ignored, and we did
not ask for "dir->show_ignored". That test used to be *together*
with the "DTYPE(de) != DT_DIR", but splitting the two tests up
means that we can do that (common) test before we even bother to
calculate the real dtype.
Of course, that optimization only matters for systems that don't
have, or don't fill in DTYPE properly.
I also clarified the real relationship between "exclude" and
"dir->show_ignored". It used to do
if (exclude != dir->show_ignored) {
..
which wasn't exactly obvious, because it triggers for two different
cases:
- the path is marked excluded, but we are not interested in ignored
files: ignore it
- the path is *not* excluded, but we *are* interested in ignored
files: ignore it unless it's a directory, in which case we might
have ignored files inside the directory and need to recurse
into it).
so this splits them into those two cases, since the first case
doesn't even care about the type.
I also made a the DT_UNKNOWN case a separate helper function,
and added some commentary to the cases.
Linus
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-prune-packed.c')
0 files changed, 0 insertions, 0 deletions