Skip to content

Commit 118f665

Browse files
brandb97gitster
authored andcommitted
pack-bitmap: reword comments in test_bitmap_commits()
In pack-bitmap.c:test_bitmap_commits(), it comments /* * As this function is only used to print bitmap selected * commits, we don't have to read the commit table. */ This suggests that we can avoid reading the commit table altogether. However, this comment is misleading. The reason we load bitmap entries here is because test_bitmap_commits() needs to print the commit IDs from the bitmap, and we must read the bitmap entries to obtain those commit IDs. So reword this comment. Signed-off-by: Lidong Yan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8a38f46 commit 118f665

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pack-bitmap.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,8 +2839,9 @@ int test_bitmap_commits(struct repository *r)
28392839
die(_("failed to load bitmap indexes"));
28402840

28412841
/*
2842-
* As this function is only used to print bitmap selected
2843-
* commits, we don't have to read the commit table.
2842+
* Since this function needs to print bitmap selected
2843+
* commits, bypass the commit lookup table (if one exists)
2844+
* by forcing the bitmap to eagerly load its entries.
28442845
*/
28452846
if (bitmap_git->table_lookup) {
28462847
if (load_bitmap_entries_v1(bitmap_git) < 0)

0 commit comments

Comments
 (0)