@@ 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) {