Skip to content

Commit

Permalink
pack-bitmap: implement bitmap_writer_has_bitmapped_object_id()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ttaylorr authored and gitster committed May 24, 2024
1 parent 0d41b18 commit 245a7f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pack-bitmap-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 2 additions & 0 deletions pack-bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ void bitmap_writer_build_type_index(struct bitmap_writer *writer,
struct packing_data *to_pack,
struct pack_idx_entry **index,
uint32_t index_nr);
int bitmap_writer_has_bitmapped_object_id(struct bitmap_writer *writer,
const struct object_id *oid);
uint32_t *create_bitmap_mapping(struct bitmap_index *bitmap_git,
struct packing_data *mapping);
int rebuild_bitmap(const uint32_t *reposition,
Expand Down

0 comments on commit 245a7f2

Please sign in to comment.