path: root/builtin/describe.c
diff options
authorJunio C Hamano <>2017-07-13 23:14:54 (GMT)
committerJunio C Hamano <>2017-07-13 23:14:54 (GMT)
commit91f69225443b3be8d3f11c5c71795169d7d00737 (patch)
tree7c891653d8fb17dfb29641cc8e56385064816e94 /builtin/describe.c
parenteac97b438c6734304c155604f4c36ac63f29ca6f (diff)
parent1ecbf31d0298a1ed952623108e23234d5cf37086 (diff)
Merge branch 'sb/hashmap-customize-comparison'
Update the hashmap API so that data to customize the behaviour of the comparison function can be specified at the time a hashmap is initialized. * sb/hashmap-customize-comparison: hashmap: migrate documentation from Documentation/technical into header patch-ids.c: use hashmap correctly hashmap.h: compare function has access to a data field
Diffstat (limited to 'builtin/describe.c')
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/describe.c b/builtin/describe.c
index 19eacdd..89ea1cd 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -54,8 +54,10 @@ static const char *prio_names[] = {
N_("head"), N_("lightweight"), N_("annotated"),
-static int commit_name_cmp(const struct commit_name *cn1,
- const struct commit_name *cn2, const void *peeled)
+static int commit_name_cmp(const void *unused_cmp_data,
+ const struct commit_name *cn1,
+ const struct commit_name *cn2,
+ const void *peeled)
return oidcmp(&cn1->peeled, peeled ? peeled : &cn2->peeled);
@@ -501,7 +503,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
return cmd_name_rev(args.argc, args.argv, prefix);
- hashmap_init(&names, (hashmap_cmp_fn) commit_name_cmp, 0);
+ hashmap_init(&names, (hashmap_cmp_fn) commit_name_cmp, NULL, 0);
for_each_rawref(get_name, NULL);
if (!names.size && !always)
die(_("No names found, cannot describe anything."));