]> git.ipfire.org Git - thirdparty/git.git/blobdiff - dir.c
Use new HASHMAP_INIT macro to simplify hashmap initialization
[thirdparty/git.git] / dir.c
diff --git a/dir.c b/dir.c
index 3018a657b059868c5a3a739d0a039311eedda5b9..161dce121e991a616412d597b163ce9c2e7123e6 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -817,8 +817,8 @@ static void add_pattern_to_hashsets(struct pattern_list *pl, struct path_pattern
 
 clear_hashmaps:
        warning(_("disabling cone pattern matching"));
-       hashmap_free_entries(&pl->parent_hashmap, struct pattern_entry, ent);
-       hashmap_free_entries(&pl->recursive_hashmap, struct pattern_entry, ent);
+       hashmap_clear_and_free(&pl->parent_hashmap, struct pattern_entry, ent);
+       hashmap_clear_and_free(&pl->recursive_hashmap, struct pattern_entry, ent);
        pl->use_cone_patterns = 0;
 }
 
@@ -921,8 +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);
+       hashmap_clear_and_free(&pl->recursive_hashmap, struct pattern_entry, ent);
+       hashmap_clear_and_free(&pl->parent_hashmap, struct pattern_entry, ent);
 
        memset(pl, 0, sizeof(*pl));
 }
@@ -2105,7 +2105,6 @@ static int resolve_dtype(int dtype, struct index_state *istate,
 }
 
 static enum path_treatment treat_path_fast(struct dir_struct *dir,
-                                          struct untracked_cache_dir *untracked,
                                           struct cached_dir *cdir,
                                           struct index_state *istate,
                                           struct strbuf *path,
@@ -2153,7 +2152,7 @@ static enum path_treatment treat_path(struct dir_struct *dir,
        int has_path_in_index, dtype, excluded;
 
        if (!cdir->d_name)
-               return treat_path_fast(dir, untracked, cdir, istate, path,
+               return treat_path_fast(dir, cdir, istate, path,
                                       baselen, pathspec);
        if (is_dot_or_dotdot(cdir->d_name) || !fspathcmp(cdir->d_name, ".git"))
                return path_none;