summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index a67930dcff..2de6491040 100644
--- a/dir.c
+++ b/dir.c
@@ -2117,7 +2117,14 @@ static enum path_treatment treat_path(struct dir_struct *dir,
baselen, excluded, pathspec);
case DT_REG:
case DT_LNK:
- return excluded ? path_excluded : path_untracked;
+ if (excluded)
+ return path_excluded;
+ if (pathspec &&
+ !do_match_pathspec(istate, pathspec, path->buf, path->len,
+ 0 /* prefix */, NULL /* seen */,
+ 0 /* flags */))
+ return path_none;
+ return path_untracked;
}
}