]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack-bitmap: reword comments in test_bitmap_commits()
authorLidong Yan <502024330056@smail.nju.edu.cn>
Tue, 1 Jul 2025 05:32:08 +0000 (05:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Jul 2025 21:41:53 +0000 (14:41 -0700)
The comment in pack-bitmap.c:test_bitmap_commits(), 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 <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c

index fd19c22551638d3d524d32c69b9531c782252b89..d1d8814be7f3f3c5b56faa9190c221ef9213e756 100644 (file)
@@ -2839,8 +2839,9 @@ int test_bitmap_commits(struct repository *r)
                die(_("failed to load bitmap indexes"));
 
        /*
-        * As this function is only used to print bitmap selected
-        * commits, we don't have to read the commit table.
+        * Since this function needs to print the bitmapped
+        * commits, bypass the commit lookup table (if one exists)
+        * by forcing the bitmap to eagerly load its entries.
         */
        if (bitmap_git->table_lookup) {
                if (load_bitmap_entries_v1(bitmap_git) < 0)