aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2024-04-29 16:43:18 -0400
committerJunio C Hamano <gitster@pobox.com>2024-04-30 13:00:25 -0700
commit38d427776bf62fd5dba09e180863a6803596b1ad (patch)
tree5cfe2c2d34d8e41f2f3276414c1d496457719e13
parent015e343f6571aad91e5d057192b35d2bd752fd17 (diff)
downloadgit-38d427776bf62fd5dba09e180863a6803596b1ad.tar.gz
pack-bitmap: implement `bitmap_writer_has_bitmapped_object_id()`
Notice: this object is not reachable from any branch.
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 <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Notice: this object is not reachable from any branch.
-rw-r--r--pack-bitmap-write.c5
-rw-r--r--pack-bitmap.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index fef02cd745..c7514a5840 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -123,6 +123,11 @@ void bitmap_writer_build_type_index(struct packing_data *to_pack,
}
}
+int bitmap_writer_has_bitmapped_object_id(const struct object_id *oid)
+{
+ return kh_get_oid_map(writer.bitmaps, *oid) != kh_end(writer.bitmaps);
+}
+
/**
* Compute the actual bitmaps
*/
diff --git a/pack-bitmap.h b/pack-bitmap.h
index ca9acd2f73..995d664cc8 100644
--- a/pack-bitmap.h
+++ b/pack-bitmap.h
@@ -98,6 +98,8 @@ int bitmap_has_oid_in_uninteresting(struct bitmap_index *, const struct object_i
off_t get_disk_usage_from_bitmap(struct bitmap_index *, struct rev_info *);
+int bitmap_writer_has_bitmapped_object_id(const struct object_id *oid);
+
void bitmap_writer_init(struct repository *r);
void bitmap_writer_show_progress(int show);
void bitmap_writer_set_checksum(const unsigned char *sha1);