]> git.ipfire.org Git - thirdparty/git.git/blobdiff - config.c
hashmap_add takes "struct hashmap_entry *"
[thirdparty/git.git] / config.c
index 3900e4947be92b916ed9b531eb455e8f856105dc..2243d7c3d63effe41ccb942850c391f14871402e 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1861,7 +1861,7 @@ static struct config_set_element *configset_find_element(struct config_set *cs,
        if (git_config_parse_key(key, &normalized_key, NULL))
                return NULL;
 
-       hashmap_entry_init(&k, strhash(normalized_key));
+       hashmap_entry_init(&k.ent, strhash(normalized_key));
        k.key = normalized_key;
        found_entry = hashmap_get(&cs->config_hash, &k, NULL);
        free(normalized_key);
@@ -1882,10 +1882,10 @@ static int configset_add_value(struct config_set *cs, const char *key, const cha
         */
        if (!e) {
                e = xmalloc(sizeof(*e));
-               hashmap_entry_init(e, strhash(key));
+               hashmap_entry_init(&e->ent, strhash(key));
                e->key = xstrdup(key);
                string_list_init(&e->value_list, 1);
-               hashmap_add(&cs->config_hash, e);
+               hashmap_add(&cs->config_hash, &e->ent);
        }
        si = string_list_append_nodup(&e->value_list, xstrdup_or_null(value));