From 245a7f2e01dc86baa08ceb70937585c6389cb9db Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Thu, 23 May 2024 17:26:32 -0400 Subject: pack-bitmap: implement `bitmap_writer_has_bitmapped_object_id()` Prepare to implement pseudo-merge bitmap selection by implementing a necessary new function, `bitmap_writer_has_bitmapped_object_id()`. This function returns whether or not the bitmap_writer selected the given object ID for bitmapping. This will allow the pseudo-merge machinery to reject candidates for pseudo-merges if they have already been selected as an ordinary bitmap tip. Signed-off-by: Taylor Blau Signed-off-by: Junio C Hamano --- pack-bitmap-write.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pack-bitmap-write.c') diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c index 60eb1e71c9..299aa8af6f 100644 --- a/pack-bitmap-write.c +++ b/pack-bitmap-write.c @@ -130,6 +130,12 @@ void bitmap_writer_build_type_index(struct bitmap_writer *writer, } } +int bitmap_writer_has_bitmapped_object_id(struct bitmap_writer *writer, + const struct object_id *oid) +{ + return kh_get_oid_map(writer->bitmaps, *oid) != kh_end(writer->bitmaps); +} + /** * Compute the actual bitmaps */ -- cgit v1.3