mercurial/dirstate.py
changeset 48291 500260410bb8
parent 48290 91f07430db8c
child 48378 3d6eb119200d
--- a/mercurial/dirstate.py	Thu Oct 28 17:26:03 2021 +0200
+++ b/mercurial/dirstate.py	Thu Oct 28 17:44:58 2021 +0200
@@ -1359,6 +1359,7 @@
         mexact = match.exact
         dirignore = self._dirignore
         checkexec = self._checkexec
+        checklink = self._checklink
         copymap = self._map.copymap
         lastnormaltime = self._lastnormaltime
 
@@ -1391,7 +1392,17 @@
             elif t.removed:
                 radd(fn)
             elif t.tracked:
-                if (
+                if not checklink and t.has_fallback_symlink:
+                    # If the file system does not support symlink, the mode
+                    # might not be correctly stored in the dirstate, so do not
+                    # trust it.
+                    ladd(fn)
+                elif not checkexec and t.has_fallback_exec:
+                    # If the file system does not support exec bits, the mode
+                    # might not be correctly stored in the dirstate, so do not
+                    # trust it.
+                    ladd(fn)
+                elif (
                     size >= 0
                     and (
                         (size != st.st_size and size != st.st_size & _rangemask)