Skip to content

Commit 73cd7d9

Browse files
peffgitster
authored andcommitted
pack-bitmap: drop bitmap_index argument from try_partial_reuse()
Starting in commit 0f533c7 (pack-bitmap: read multi-pack bitmaps, 2021-08-31), we no longer look at the "struct bitmap_index" passed to try_partial_reuse(). This is because we only handle verbatim reuse from a single pack: either the pack whose bitmap we're looking at, or the "preferred" pack of a midx bitmap. And thus the primary item we look at is the "pack" parameter added by that same commit, and not the bitmap_git->pack parameter (which would be NULL for a midx bitmap). It's our caller, reuse_partial_packfile_from_bitmap(), which decides which pack to use and passes it in to us. Drop the unused parameter to prevent confusion. Signed-off-by: Jeff King <[email protected]> Reviewed-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bfbb60d commit 73cd7d9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pack-bitmap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,8 +1328,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
13281328
* -1 means "stop trying further objects"; 0 means we may or may not have
13291329
* reused, but you can keep feeding bits.
13301330
*/
1331-
static int try_partial_reuse(struct bitmap_index *bitmap_git,
1332-
struct packed_git *pack,
1331+
static int try_partial_reuse(struct packed_git *pack,
13331332
size_t pos,
13341333
struct bitmap *reuse,
13351334
struct pack_window **w_curs)
@@ -1476,7 +1475,7 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
14761475
break;
14771476

14781477
offset += ewah_bit_ctz64(word >> offset);
1479-
if (try_partial_reuse(bitmap_git, pack, pos + offset,
1478+
if (try_partial_reuse(pack, pos + offset,
14801479
reuse, &w_curs) < 0) {
14811480
/*
14821481
* try_partial_reuse indicated we couldn't reuse

0 commit comments

Comments
 (0)