]> git.ipfire.org Git - thirdparty/git.git/blobdiff - refs.c
The first batch post 2.24 cycle
[thirdparty/git.git] / refs.c
diff --git a/refs.c b/refs.c
index 43a95105f18d4c7ea2f010fd053a3c0243f63adc..1ab0bb54d3d73bfe17f0eab4cd02d760bb9a7d01 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -1772,7 +1772,7 @@ int resolve_gitlink_ref(const char *submodule, const char *refname,
 
 struct ref_store_hash_entry
 {
-       struct hashmap_entry ent; /* must be the first member! */
+       struct hashmap_entry ent;
 
        struct ref_store *refs;
 
@@ -1781,11 +1781,16 @@ struct ref_store_hash_entry
 };
 
 static int ref_store_hash_cmp(const void *unused_cmp_data,
-                             const void *entry, const void *entry_or_key,
+                             const struct hashmap_entry *eptr,
+                             const struct hashmap_entry *entry_or_key,
                              const void *keydata)
 {
-       const struct ref_store_hash_entry *e1 = entry, *e2 = entry_or_key;
-       const char *name = keydata ? keydata : e2->name;
+       const struct ref_store_hash_entry *e1, *e2;
+       const char *name;
+
+       e1 = container_of(eptr, const struct ref_store_hash_entry, ent);
+       e2 = container_of(entry_or_key, const struct ref_store_hash_entry, ent);
+       name = keydata ? keydata : e2->name;
 
        return strcmp(e1->name, name);
 }