Skip to content

Commit 245a7f2

Browse files
ttaylorrgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0d41b18 commit 245a7f2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

pack-bitmap-write.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ void bitmap_writer_build_type_index(struct bitmap_writer *writer,
130130
}
131131
}
132132

133+
int bitmap_writer_has_bitmapped_object_id(struct bitmap_writer *writer,
134+
const struct object_id *oid)
135+
{
136+
return kh_get_oid_map(writer->bitmaps, *oid) != kh_end(writer->bitmaps);
137+
}
138+
133139
/**
134140
* Compute the actual bitmaps
135141
*/

pack-bitmap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ void bitmap_writer_build_type_index(struct bitmap_writer *writer,
125125
struct packing_data *to_pack,
126126
struct pack_idx_entry **index,
127127
uint32_t index_nr);
128+
int bitmap_writer_has_bitmapped_object_id(struct bitmap_writer *writer,
129+
const struct object_id *oid);
128130
uint32_t *create_bitmap_mapping(struct bitmap_index *bitmap_git,
129131
struct packing_data *mapping);
130132
int rebuild_bitmap(const uint32_t *reposition,

0 commit comments

Comments
 (0)