rust/hg-core/src/dirstate/status.rs
branchstable
changeset 44748 a467416c493c
parent 44747 d8b703b8bf70
child 44837 dc60ba32d43b
--- a/rust/hg-core/src/dirstate/status.rs	Mon Apr 20 11:03:31 2020 +0200
+++ b/rust/hg-core/src/dirstate/status.rs	Thu Apr 23 09:59:38 2020 +0200
@@ -323,6 +323,11 @@
     let file_type = dir_entry.file_type()?;
     let entry_option = dmap.get(&filename);
 
+    if filename.as_bytes() == b".hg" {
+        // Could be a directory or a symlink
+        return Ok(());
+    }
+
     if file_type.is_dir() {
         handle_traversed_dir(
             scope,
@@ -446,9 +451,7 @@
     options: StatusOptions,
 ) -> IoResult<()> {
     let directory = directory.as_ref();
-    if directory.as_bytes() == b".hg" {
-        return Ok(());
-    }
+
     let visit_entries = match matcher.visit_children_set(directory) {
         VisitChildrenSet::Empty => return Ok(()),
         VisitChildrenSet::This | VisitChildrenSet::Recursive => None,