rust-status: stop using `state()` in `handle_normal_file`
authorRaphaël Gomès <rgomes@octobus.net>
Tue, 12 Apr 2022 17:34:18 +0200
changeset 49141 126d253eb274
parent 49140 748ac6400eaa
child 49142 c4ccd0346f5c
rust-status: stop using `state()` in `handle_normal_file` Let's use the new API Differential Revision: https://phab.mercurial-scm.org/D12539
rust/hg-core/src/dirstate_tree/status.rs
--- a/rust/hg-core/src/dirstate_tree/status.rs	Tue Apr 12 17:30:34 2022 +0200
+++ b/rust/hg-core/src/dirstate_tree/status.rs	Tue Apr 12 17:34:18 2022 +0200
@@ -653,10 +653,15 @@
         &self,
         dirstate_node: &NodeRef<'tree, 'on_disk>,
     ) -> Result<(), DirstateV2ParseError> {
-        if let Some(state) = dirstate_node.state()? {
+        if let Some(entry) = dirstate_node.entry()? {
+            if !entry.any_tracked() {
+                // Future-compat for when we start storing ignored and unknown
+                // files for caching reasons
+                return Ok(());
+            }
             let path = dirstate_node.full_path(self.dmap.on_disk)?;
             if self.matcher.matches(path) {
-                if let EntryState::Removed = state {
+                if entry.removed() {
                     self.push_outcome(Outcome::Removed, dirstate_node)?
                 } else {
                     self.push_outcome(Outcome::Deleted, &dirstate_node)?