summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-06 23:30:29 +0000
committerJunio C Hamano <gitster@pobox.com>2019-10-07 10:20:10 +0900
commitb94e5c1df674eb4ec8fdeaaae1ad8df552cb5d70 (patch)
tree81566486743a5dafb2dddaf09de597529223f315 /merge-recursive.c
parentf6eb6bdcf2719defc3d38e0e2712fa3e18d29e91 (diff)
downloadgit-b94e5c1df674eb4ec8fdeaaae1ad8df552cb5d70.tar.gz
hashmap_add takes "struct hashmap_entry *"
This is less error-prone than "void *" as the compiler now detects invalid types being passed. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 6bc4f14ff4..db9b247ece 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -455,7 +455,7 @@ static int save_files_dirs(const struct object_id *oid,
FLEX_ALLOC_MEM(entry, path, base->buf, base->len);
hashmap_entry_init(&entry->e, path_hash(entry->path));
- hashmap_add(&opt->current_file_dir_set, entry);
+ hashmap_add(&opt->current_file_dir_set, &entry->e);
strbuf_setlen(base, baselen);
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
@@ -732,7 +732,7 @@ static char *unique_path(struct merge_options *opt, const char *path, const char
FLEX_ALLOC_MEM(entry, path, newpath.buf, newpath.len);
hashmap_entry_init(&entry->e, path_hash(entry->path));
- hashmap_add(&opt->current_file_dir_set, entry);
+ hashmap_add(&opt->current_file_dir_set, &entry->e);
return strbuf_detach(&newpath, NULL);
}