static void update_one(const char *path)
{
- if (!verify_path(path)) {
+ int stat_errno = 0;
+ struct stat st;
+
- if (mark_valid_only || mark_skip_worktree_only || force_remove)
++ if (mark_valid_only || mark_skip_worktree_only || force_remove ||
++ mark_fsmonitor_only)
+ st.st_mode = 0;
+ else if (lstat(path, &st) < 0) {
+ st.st_mode = 0;
+ stat_errno = errno;
+ } /* else stat is valid */
+
+ if (!verify_path(path, st.st_mode)) {
fprintf(stderr, "Ignoring path %s\n", path);
return;
}
{
if (!istate->untracked || !istate->untracked->root)
return;
- if (!safe_path && !verify_path(path))
++ if (!safe_path && !verify_path(path, 0))
+ return;
invalidate_one_component(istate->untracked, istate->untracked->root,
path, strlen(path));
}