diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/describe.c | 3 | ||||
-rw-r--r-- | builtin/difftool.c | 2 | ||||
-rw-r--r-- | builtin/fast-export.c | 2 | ||||
-rw-r--r-- | builtin/fetch.c | 11 |
4 files changed, 11 insertions, 7 deletions
diff --git a/builtin/describe.c b/builtin/describe.c index f5e0a7e033..c6d2386b64 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -76,7 +76,8 @@ static int commit_name_neq(const void *unused_cmp_data, static inline struct commit_name *find_commit_name(const struct object_id *peeled) { - return hashmap_get_from_hash(&names, oidhash(peeled), peeled); + return hashmap_get_entry_from_hash(&names, oidhash(peeled), peeled, + struct commit_name, entry); } static int replace_name(struct commit_name *e, diff --git a/builtin/difftool.c b/builtin/difftool.c index f41298d199..fa9c862e3a 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -162,7 +162,7 @@ static void add_left_or_right(struct hashmap *map, const char *path, FLEX_ALLOC_STR(e, path, path); hashmap_entry_init(&e->entry, strhash(path)); - existing = hashmap_get(map, &e->entry, NULL); + existing = hashmap_get_entry(map, e, NULL, struct pair_entry, entry); if (existing) { free(e); e = existing; diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 192e21dae4..25195badd4 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -151,7 +151,7 @@ static const void *anonymize_mem(struct hashmap *map, hashmap_entry_init(&key.hash, memhash(orig, *len)); key.orig = orig; key.orig_len = *len; - ret = hashmap_get(map, &key.hash, NULL); + ret = hashmap_get_entry(map, &key, NULL, struct anonymized_entry, hash); if (!ret) { ret = xmalloc(sizeof(*ret)); diff --git a/builtin/fetch.c b/builtin/fetch.c index 909dbde909..d06f2b98aa 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -383,8 +383,10 @@ static void find_non_local_tags(const struct ref *refs, for_each_string_list_item(remote_ref_item, &remote_refs_list) { const char *refname = remote_ref_item->string; struct ref *rm; + unsigned int hash = strhash(refname); - item = hashmap_get_from_hash(&remote_refs, strhash(refname), refname); + item = hashmap_get_entry_from_hash(&remote_refs, hash, refname, + struct refname_hash_entry, ent); if (!item) BUG("unseen remote ref?"); @@ -516,10 +518,11 @@ static struct ref *get_ref_map(struct remote *remote, if (rm->peer_ref) { const char *refname = rm->peer_ref->name; struct refname_hash_entry *peer_item; + unsigned int hash = strhash(refname); - peer_item = hashmap_get_from_hash(&existing_refs, - strhash(refname), - refname); + peer_item = hashmap_get_entry_from_hash(&existing_refs, + hash, refname, + struct refname_hash_entry, ent); if (peer_item) { struct object_id *old_oid = &peer_item->oid; oidcpy(&rm->peer_ref->old_oid, old_oid); |