aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commit-graph.c2
-rw-r--r--oidmap.h4
-rw-r--r--replace-object.h2
3 files changed, 6 insertions, 2 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 6394752b0b..1a74e1e1ba 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -222,7 +222,7 @@ static int commit_graph_compatible(struct repository *r)
if (replace_refs_enabled(r)) {
prepare_replace_object(r);
- if (hashmap_get_size(&r->objects->replace_map->map))
+ if (oidmap_get_size(r->objects->replace_map))
return 0;
}
diff --git a/oidmap.h b/oidmap.h
index 603ae1adbc..67fb32290f 100644
--- a/oidmap.h
+++ b/oidmap.h
@@ -67,6 +67,10 @@ void *oidmap_put(struct oidmap *map, void *entry);
*/
void *oidmap_remove(struct oidmap *map, const struct object_id *key);
+static inline unsigned int oidmap_get_size(struct oidmap *map)
+{
+ return hashmap_get_size(&map->map);
+}
struct oidmap_iter {
struct hashmap_iter h_iter;
diff --git a/replace-object.h b/replace-object.h
index ba478eb30c..4226376534 100644
--- a/replace-object.h
+++ b/replace-object.h
@@ -47,7 +47,7 @@ static inline const struct object_id *lookup_replace_object(struct repository *r
{
if (!replace_refs_enabled(r) ||
(r->objects->replace_map_initialized &&
- r->objects->replace_map->map.tablesize == 0))
+ oidmap_get_size(r->objects->replace_map) == 0))
return oid;
return do_lookup_replace_object(r, oid);
}