]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/difftool.c
Merge branch 'en/strmap'
[thirdparty/git.git] / builtin / difftool.c
index 7ac432b88193e7468048821a372dae8c2a81919a..6e18e623fddfbfb33a3de9f4df8cabbbc048ed51 100644 (file)
@@ -342,7 +342,10 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
        const char *workdir, *tmp;
        int ret = 0, i;
        FILE *fp;
-       struct hashmap working_tree_dups, submodules, symlinks2;
+       struct hashmap working_tree_dups = HASHMAP_INIT(working_tree_entry_cmp,
+                                                       NULL);
+       struct hashmap submodules = HASHMAP_INIT(pair_cmp, NULL);
+       struct hashmap symlinks2 = HASHMAP_INIT(pair_cmp, NULL);
        struct hashmap_iter iter;
        struct pair_entry *entry;
        struct index_state wtindex;
@@ -383,10 +386,6 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
        rdir_len = rdir.len;
        wtdir_len = wtdir.len;
 
-       hashmap_init(&working_tree_dups, working_tree_entry_cmp, NULL, 0);
-       hashmap_init(&submodules, pair_cmp, NULL, 0);
-       hashmap_init(&symlinks2, pair_cmp, NULL, 0);
-
        child.no_stdin = 1;
        child.git_cmd = 1;
        child.use_shell = 0;