]> git.ipfire.org Git - thirdparty/git.git/blobdiff - dir.c
dir: also check directories for matching pathspecs
[thirdparty/git.git] / dir.c
diff --git a/dir.c b/dir.c
index bf1a74799e137bb9339900ca177e843673ae44c5..76a3c3894b63c5b5950a0e40aacc039b4593dba3 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1951,6 +1951,11 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
                                                         check_only, stop_at_first_file, pathspec);
                        if (subdir_state > dir_state)
                                dir_state = subdir_state;
+
+                       if (!match_pathspec(istate, pathspec, path.buf, path.len,
+                                           0 /* prefix */, NULL,
+                                           0 /* do NOT special case dirs */))
+                               state = path_none;
                }
 
                if (check_only) {