Skip to content

Commit 9675b06

Browse files
ttaylorrgitster
authored andcommitted
pack-bitmap: drop unused max_bitmaps parameter
The `max_bitmaps` parameter in `bitmap_writer_select_commits()` was introduced back in 7cc8f97 (pack-objects: implement bitmap writing, 2013-12-21), making it original to the bitmap implementation in Git itself. When that patch was merged via 0f9e62e (Merge branch 'jk/pack-bitmap', 2014-02-27), its sole caller in builtin/pack-objects.c passed a value of "-1" for `max_bitmaps`, indicating no limit. Since then, the only other caller (in midx.c, added via c528e17 (pack-bitmap: write multi-pack bitmaps, 2021-08-31)) also uses a value of "-1" for `max_bitmaps`. Since no callers have needed a finite limit for the `max_bitmaps` parameter in the nearly decade that has passed since 0f9e62e, let's remove the parameter and any dead pieces of code connected to it. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07647c9 commit 9675b06

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

builtin/pack-objects.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,8 +1364,7 @@ static void write_pack_file(void)
13641364
progress);
13651365
bitmap_writer_select_commits(&bitmap_writer,
13661366
indexed_commits,
1367-
indexed_commits_nr,
1368-
-1);
1367+
indexed_commits_nr);
13691368
if (bitmap_writer_build(&bitmap_writer, &to_pack) < 0)
13701369
die(_("failed to write bitmap index"));
13711370
bitmap_writer_finish(&bitmap_writer,

midx-write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ static int write_midx_bitmap(const char *midx_name,
841841
for (i = 0; i < pdata->nr_objects; i++)
842842
index[pack_order[i]] = &pdata->objects[i].idx;
843843

844-
bitmap_writer_select_commits(&writer, commits, commits_nr, -1);
844+
bitmap_writer_select_commits(&writer, commits, commits_nr);
845845
ret = bitmap_writer_build(&writer, pdata);
846846
if (ret < 0)
847847
goto cleanup;

pack-bitmap-write.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,7 @@ static int date_compare(const void *_a, const void *_b)
587587

588588
void bitmap_writer_select_commits(struct bitmap_writer *writer,
589589
struct commit **indexed_commits,
590-
unsigned int indexed_commits_nr,
591-
int max_bitmaps)
590+
unsigned int indexed_commits_nr)
592591
{
593592
unsigned int i = 0, j, next;
594593

@@ -611,11 +610,6 @@ void bitmap_writer_select_commits(struct bitmap_writer *writer,
611610
if (i + next >= indexed_commits_nr)
612611
break;
613612

614-
if (max_bitmaps > 0 && writer->selected_nr >= max_bitmaps) {
615-
writer->selected_nr = max_bitmaps;
616-
break;
617-
}
618-
619613
if (next == 0) {
620614
chosen = indexed_commits[i];
621615
} else {

pack-bitmap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ struct ewah_bitmap *bitmap_for_commit(struct bitmap_index *bitmap_git,
131131
struct commit *commit);
132132
void bitmap_writer_select_commits(struct bitmap_writer *writer,
133133
struct commit **indexed_commits,
134-
unsigned int indexed_commits_nr,
135-
int max_bitmaps);
134+
unsigned int indexed_commits_nr);
136135
int bitmap_writer_build(struct bitmap_writer *writer,
137136
struct packing_data *to_pack);
138137
void bitmap_writer_finish(struct bitmap_writer *writer,

0 commit comments

Comments
 (0)