Skip to content

Commit 7940941

Browse files
derrickstoleegitster
authored andcommitted
pack-objects: use rev.filter when possible
In builtin/pack-objects.c, we use a 'filter_options' global to populate the --filter=<X> argument. The previous change created a pointer to a filter option in 'struct rev_info', so we can use that pointer here as a start to simplifying some usage of object filters. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ffaa137 commit 7940941

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

builtin/pack-objects.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,7 +3651,7 @@ static int pack_options_allow_reuse(void)
36513651

36523652
static int get_object_list_from_bitmap(struct rev_info *revs)
36533653
{
3654-
if (!(bitmap_git = prepare_bitmap_walk(revs, &filter_options, 0)))
3654+
if (!(bitmap_git = prepare_bitmap_walk(revs, &revs->filter, 0)))
36553655
return -1;
36563656

36573657
if (pack_options_allow_reuse() &&
@@ -3727,6 +3727,7 @@ static void get_object_list(int ac, const char **av)
37273727
repo_init_revisions(the_repository, &revs, NULL);
37283728
save_commit_buffer = 0;
37293729
setup_revisions(ac, av, &revs, &s_r_opt);
3730+
list_objects_filter_copy(&revs.filter, &filter_options);
37303731

37313732
/* make sure shallows are read */
37323733
is_repository_shallow(the_repository);
@@ -3777,7 +3778,7 @@ static void get_object_list(int ac, const char **av)
37773778

37783779
if (!fn_show_object)
37793780
fn_show_object = show_object;
3780-
traverse_commit_list_filtered(&filter_options, &revs,
3781+
traverse_commit_list_filtered(&revs.filter, &revs,
37813782
show_commit, fn_show_object, NULL,
37823783
NULL);
37833784

0 commit comments

Comments
 (0)