mercurial/cext/parsers.c
changeset 48399 af303ae33cd7
parent 48398 111098af6356
child 48400 0b3f3a3ca50a
--- a/mercurial/cext/parsers.c	Wed Nov 24 04:40:00 2021 +0100
+++ b/mercurial/cext/parsers.c	Wed Nov 24 04:51:05 2021 +0100
@@ -335,10 +335,20 @@
 	                      &other_second_ambiguous)) {
 		return NULL;
 	}
-	if ((self->flags & dirstate_flag_has_mtime) &&
-	    self->mtime_s == other_s &&
-	    (self->mtime_ns == other_ns || self->mtime_ns == 0 ||
-	     other_ns == 0)) {
+	if (!(self->flags & dirstate_flag_has_mtime)) {
+		Py_RETURN_FALSE;
+	}
+	if (self->mtime_s != other_s) {
+		Py_RETURN_FALSE;
+	}
+	if (self->mtime_ns == 0 || other_ns == 0) {
+		if (self->flags & dirstate_flag_mtime_second_ambiguous) {
+			Py_RETURN_FALSE;
+		} else {
+			Py_RETURN_TRUE;
+		}
+	}
+	if (self->mtime_ns == other_ns) {
 		Py_RETURN_TRUE;
 	} else {
 		Py_RETURN_FALSE;