rust/hg-core/src/dirstate_tree/status.rs
changeset 48218 15dedc0c5c35
parent 48193 320de901896a
child 48257 f45d35950db6
--- a/rust/hg-core/src/dirstate_tree/status.rs	Fri Sep 17 15:07:30 2021 -0400
+++ b/rust/hg-core/src/dirstate_tree/status.rs	Wed Oct 13 16:21:39 2021 +0200
@@ -199,15 +199,14 @@
                 // by a previous run of the `status` algorithm which found this
                 // directory eligible for `read_dir` caching.
                 if let Some(meta) = directory_metadata {
-                    if let Ok(current_mtime) = meta.modified() {
-                        let truncated =
-                            TruncatedTimestamp::from(current_mtime);
-                        if truncated.very_likely_equal(&cached_mtime) {
-                            // The mtime of that directory has not changed
-                            // since then, which means that the results of
-                            // `read_dir` should also be unchanged.
-                            return true;
-                        }
+                    if cached_mtime
+                        .very_likely_equal_to_mtime_of(meta)
+                        .unwrap_or(false)
+                    {
+                        // The mtime of that directory has not changed
+                        // since then, which means that the results of
+                        // `read_dir` should also be unchanged.
+                        return true;
                     }
                 }
             }
@@ -472,7 +471,7 @@
                     let is_up_to_date = if let Some(cached) =
                         dirstate_node.cached_directory_mtime()?
                     {
-                        cached.very_likely_equal(&truncated)
+                        cached.very_likely_equal(truncated)
                     } else {
                         false
                     };