diff options
author | Samuel Lijin <sxlijin@gmail.com> | 2017-05-18 04:21:52 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-22 12:14:09 +0900 |
commit | fb898888491b83c9a3396fb559032ca78807a0c0 (patch) | |
tree | 0af74000ad2fcf7f9310422324b1ec70e976c2db /dir.h | |
parent | df5bcdf83aeb94718602ebc8c0f597166bb493f1 (diff) | |
download | git-fb898888491b83c9a3396fb559032ca78807a0c0.tar.gz |
dir: hide untracked contents of untracked dirs
When we taught read_directory_recursive() to recurse into untracked
directories in search of ignored files given DIR_SHOW_IGNORED_TOO, that
had the side effect of teaching it to collect the untracked contents of
untracked directories. It doesn't always make sense to return these,
though (we do need them for `clean -d`), so we introduce a flag
(DIR_KEEP_UNTRACKED_CONTENTS) to control whether or not read_directory()
strips dir->entries of the untracked contents of untracked dirs.
We also introduce check_contains() to check if one dir_entry corresponds
to a path which contains the path corresponding to another dir_entry.
This also fixes known breakages in t7061, since status --ignored now
searches untracked directories for ignored files.
Signed-off-by: Samuel Lijin <sxlijin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.h')
-rw-r--r-- | dir.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -151,7 +151,8 @@ struct dir_struct { DIR_NO_GITLINKS = 1<<3, DIR_COLLECT_IGNORED = 1<<4, DIR_SHOW_IGNORED_TOO = 1<<5, - DIR_COLLECT_KILLED_ONLY = 1<<6 + DIR_COLLECT_KILLED_ONLY = 1<<6, + DIR_KEEP_UNTRACKED_CONTENTS = 1<<7 } flags; struct dir_entry **entries; struct dir_entry **ignored; |