dir.c: avoid stat() in valid_cached_dir()
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index 3c54366a1730ec37fcc56e185e2362e12d89b566..ee1605f004d71c734dfc8e211493706fa39f2493 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1739,7 +1739,7 @@ static int valid_cached_dir(struct dir_struct *dir,
         */
        refresh_fsmonitor(istate);
        if (!(dir->untracked->use_fsmonitor && untracked->valid)) {
-               if (stat(path->len ? path->buf : ".", &st)) {
+               if (lstat(path->len ? path->buf : ".", &st)) {
                        invalidate_directory(dir->untracked, untracked);
                        memset(&untracked->stat_data, 0, sizeof(untracked->stat_data));
                        return 0;