463262a375bf — Sean Farley 13 years ago
fast-status: use lstat instead of stat; fixes checking for links and executable bit changes
1 files changed, 3 insertions(+), 2 deletions(-)

M fast-hg-status.c
M fast-hg-status.c +3 -2
@@ 105,9 105,10 @@ int parse_dirstate(const char* hg_path, 
     sprintf(filepath, "%s/%s", hg_path, filename);
 
     /* size needs to be >= 0 by definition of the dirstate */
-    if (stat(filepath, &filestat)) return -2;
+    if (lstat(filepath, &filestat)) return -2;
 
-    if (mode != (filestat.st_mode & 0777 & ~u)) {
+    if (((mode ^ filestat.st_mode) & 0111 & ~u) && ((mode & S_IFLNK) != S_IFLNK)) {
+      PRINT(("[%zu] filestat.st_mode: %.3o\n", i, filestat.st_mode));
       dirty("above file's mode changed");
       break;
     } else if (mtime != filestat.st_mtime && size != filestat.st_size) {