diff mercurial/dirstate.py @ 46385:0d055849d5f9 stable

enclink: check contents of symlinks not just size in case of fcrypt Check content of symlinks because st_size may indicate the size of encrypted data which does not match actual link value. Differential Revision: https://phab.mercurial-scm.org/D10146
author Corey Schuhen <cschuhen@topcon.com>
date Wed, 10 Mar 2021 15:24:52 +1000
parents 89a2afe31e82
children ca69e29a2a30
line wrap: on
line diff
--- a/mercurial/dirstate.py	Tue Mar 09 11:19:11 2021 +0530
+++ b/mercurial/dirstate.py	Wed Mar 10 15:24:52 2021 +1000
@@ -1279,7 +1279,12 @@
                     or size == -2  # other parent
                     or fn in copymap
                 ):
-                    madd(fn)
+                    if (stat.S_ISLNK(st.st_mode) and size != st.st_size):
+                        # issue6456: Size returned may be longer due to
+                        # encryption on EXT-4 fscrypt, undecided.
+                        ladd(fn)
+                    else:
+                        madd(fn)
                 elif (
                     time != st[stat.ST_MTIME]
                     and time != st[stat.ST_MTIME] & _rangemask