]> git.ipfire.org Git - thirdparty/git.git/blobdiff - dir.c
Merge branch 'ea/blame-use-oideq'
[thirdparty/git.git] / dir.c
diff --git a/dir.c b/dir.c
index 8d6c59a9dcf2e8221d07c7ac7a4bf68e88f1e5e6..3018a657b059868c5a3a739d0a039311eedda5b9 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -921,6 +921,8 @@ void clear_pattern_list(struct pattern_list *pl)
                free(pl->patterns[i]);
        free(pl->patterns);
        free(pl->filebuf);
+       hashmap_free_entries(&pl->recursive_hashmap, struct pattern_entry, ent);
+       hashmap_free_entries(&pl->parent_hashmap, struct pattern_entry, ent);
 
        memset(pl, 0, sizeof(*pl));
 }
@@ -1797,9 +1799,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 &&