summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index 8d6c59a9dc..abb071a7a2 100644
--- a/dir.c
+++ b/dir.c
@@ -1797,9 +1797,12 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
nested_repo = is_nonbare_repository_dir(&sb);
strbuf_release(&sb);
}
- if (nested_repo)
- return ((dir->flags & DIR_SKIP_NESTED_GIT) ? path_none :
- (excluded ? path_excluded : path_untracked));
+ if (nested_repo) {
+ if ((dir->flags & DIR_SKIP_NESTED_GIT) ||
+ (matches_how == MATCHED_RECURSIVELY_LEADING_PATHSPEC))
+ return path_none;
+ return excluded ? path_excluded : path_untracked;
+ }
if (!(dir->flags & DIR_SHOW_OTHER_DIRECTORIES)) {
if (excluded &&