changeset 49195:748ac6400eaa

rust-dirstatemap: stop using `state()` in the cache logic Let's use the new API Differential Revision: https://phab.mercurial-scm.org/D12538
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 12 Apr 2022 17:30:34 +0200
parents 7241b3721ba5
children 126d253eb274
files rust/hg-core/src/dirstate_tree/dirstate_map.rs
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Tue Apr 12 16:24:25 2022 +0200
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Tue Apr 12 17:30:34 2022 +0200
@@ -1182,8 +1182,8 @@
             if let Some(node) = map.get_node(directory)? {
                 // A node without a `DirstateEntry` was created to hold child
                 // nodes, and is therefore a directory.
-                let state = node.state()?;
-                Ok(state.is_none() && node.tracked_descendants_count() > 0)
+                let is_dir = node.entry()?.is_none();
+                Ok(is_dir && node.tracked_descendants_count() > 0)
             } else {
                 Ok(false)
             }
@@ -1198,8 +1198,8 @@
             if let Some(node) = map.get_node(directory)? {
                 // A node without a `DirstateEntry` was created to hold child
                 // nodes, and is therefore a directory.
-                let state = node.state()?;
-                Ok(state.is_none() && node.descendants_with_entry_count() > 0)
+                let is_dir = node.entry()?.is_none();
+                Ok(is_dir && node.descendants_with_entry_count() > 0)
             } else {
                 Ok(false)
             }