Show More
@@ -126,17 +126,21 b" impl<'tree, 'a> StatusCommon<'tree, 'a> " | |||
|
126 | 126 | dirstate_node: &'tree mut Node, |
|
127 | 127 | has_ignored_ancestor: bool, |
|
128 | 128 | ) { |
|
129 |
|
|
|
130 | if self.options.collect_traversed_dirs { | |
|
131 | self.outcome.traversed.push(hg_path.into()) | |
|
132 | } | |
|
129 | let file_type = fs_entry.metadata.file_type(); | |
|
130 | let file_or_symlink = file_type.is_file() || file_type.is_symlink(); | |
|
131 | if !file_or_symlink { | |
|
133 | 132 | // If we previously had a file here, it was removed (with |
|
134 | 133 | // `hg rm` or similar) or deleted before it could be |
|
135 | // replaced by a directory. | |
|
134 | // replaced by a directory or something else. | |
|
136 | 135 | self.mark_removed_or_deleted_if_file( |
|
137 | 136 | hg_path, |
|
138 | 137 | dirstate_node.state(), |
|
139 | 138 | ); |
|
139 | } | |
|
140 | if file_type.is_dir() { | |
|
141 | if self.options.collect_traversed_dirs { | |
|
142 | self.outcome.traversed.push(hg_path.into()) | |
|
143 | } | |
|
140 | 144 | let is_ignored = has_ignored_ancestor || (self.ignore_fn)(hg_path); |
|
141 | 145 | let is_at_repo_root = false; |
|
142 | 146 | self.traverse_fs_directory_and_dirstate( |
@@ -147,7 +151,7 b" impl<'tree, 'a> StatusCommon<'tree, 'a> " | |||
|
147 | 151 | is_at_repo_root, |
|
148 | 152 | ); |
|
149 | 153 | } else { |
|
150 | if self.matcher.matches(hg_path) { | |
|
154 | if file_or_symlink && self.matcher.matches(hg_path) { | |
|
151 | 155 | let full_path = Cow::from(hg_path); |
|
152 | 156 | if let Some(entry) = &dirstate_node.entry { |
|
153 | 157 | match entry.state { |
@@ -276,7 +280,9 b" impl<'tree, 'a> StatusCommon<'tree, 'a> " | |||
|
276 | 280 | fs_entry: &DirEntry, |
|
277 | 281 | ) { |
|
278 | 282 | let hg_path = directory_hg_path.join(&fs_entry.base_name); |
|
279 |
|
|
|
283 | let file_type = fs_entry.metadata.file_type(); | |
|
284 | let file_or_symlink = file_type.is_file() || file_type.is_symlink(); | |
|
285 | if file_type.is_dir() { | |
|
280 | 286 | let is_ignored = |
|
281 | 287 | has_ignored_ancestor || (self.ignore_fn)(&hg_path); |
|
282 | 288 | let traverse_children = if is_ignored { |
@@ -304,7 +310,7 b" impl<'tree, 'a> StatusCommon<'tree, 'a> " | |||
|
304 | 310 | if self.options.collect_traversed_dirs { |
|
305 | 311 | self.outcome.traversed.push(hg_path.into()) |
|
306 | 312 | } |
|
307 | } else if self.matcher.matches(&hg_path) { | |
|
313 | } else if file_or_symlink && self.matcher.matches(&hg_path) { | |
|
308 | 314 | self.mark_unknown_or_ignored(has_ignored_ancestor, hg_path.into()) |
|
309 | 315 | } |
|
310 | 316 | } |
General Comments 0
You need to be logged in to leave comments.
Login now