rust/hg-core/src/dirstate/entry.rs
changeset 48447 af303ae33cd7
parent 48446 111098af6356
child 48448 0b3f3a3ca50a
--- a/rust/hg-core/src/dirstate/entry.rs	Wed Nov 24 04:40:00 2021 +0100
+++ b/rust/hg-core/src/dirstate/entry.rs	Wed Nov 24 04:51:05 2021 +0100
@@ -130,10 +130,17 @@
     /// in that way, doing a simple comparison would cause many false
     /// negatives.
     pub fn likely_equal(self, other: Self) -> bool {
-        self.truncated_seconds == other.truncated_seconds
-            && (self.nanoseconds == other.nanoseconds
-                || self.nanoseconds == 0
-                || other.nanoseconds == 0)
+        if self.truncated_seconds != other.truncated_seconds {
+            false
+        } else if self.nanoseconds == 0 || other.nanoseconds == 0 {
+            if self.second_ambiguous {
+                false
+            } else {
+                true
+            }
+        } else {
+            self.nanoseconds == other.nanoseconds
+        }
     }
 
     pub fn likely_equal_to_mtime_of(