diff rust/hg-core/src/utils/files.rs @ 46757:3c9ddb1986a9

rust-status: fix issue6456 for the Rust implementation also This implementation is being used by a few people now, so we need it fixed, even though a big rewrite will be coming quite soon. Differential Revision: https://phab.mercurial-scm.org/D10217
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 15 Mar 2021 13:05:00 +0100
parents 91ab5190a3de
children c94fa884240b
line wrap: on
line diff
--- a/rust/hg-core/src/utils/files.rs	Tue Mar 16 00:07:12 2021 +0100
+++ b/rust/hg-core/src/utils/files.rs	Mon Mar 15 13:05:00 2021 +0100
@@ -199,6 +199,12 @@
             st_ctime: metadata.ctime(),
         }
     }
+
+    pub fn is_symlink(&self) -> bool {
+        // This is way too manual, but `HgMetadata` will go away in the
+        // near-future dirstate rewrite anyway.
+        self.st_mode & 0170000 == 0120000
+    }
 }
 
 /// Returns the canonical path of `name`, given `cwd` and `root`