difftool: handle unmerged files in dir-diff mode
[gitweb.git] / submodule-config.c
index fe8ceabf3009db672d4d2dc5121123961c298212..8476e0fa0f89c968e95182fd44211c0018a4b1f8 100644 (file)
@@ -392,8 +392,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,
                struct hashmap_iter iter;
                struct submodule_entry *entry;
 
-               hashmap_iter_init(&cache->for_name, &iter);
-               entry = hashmap_iter_next(&iter);
+               entry = hashmap_iter_first(&cache->for_name, &iter);
                if (!entry)
                        return NULL;
                return entry->config;
@@ -427,8 +426,8 @@ static const struct submodule *config_from(struct submodule_cache *cache,
        parameter.commit_sha1 = commit_sha1;
        parameter.gitmodules_sha1 = sha1;
        parameter.overwrite = 0;
-       git_config_from_buf(parse_config, rev.buf, config, config_size,
-                       &parameter);
+       git_config_from_mem(parse_config, "submodule-blob", rev.buf,
+                       config, config_size, &parameter);
        free(config);
 
        switch (lookup_type) {