pack-objects: parse --filter directly into revs.filter

The previous change moved the 'revs' variable into cmd_pack_objects() and now we can remove the global filter_options in favor of revs.filter. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Mar 22, 2022 at 17:28 UTC 831ee253b7e07dbca3daafcc9cf9143e53220df7
1 file changed +2 -6
builtin/pack-objects.c
+2 -6
@@ -237,8 +237,6 @@ static unsigned long cache_max_small_delta_size = 1000;
237
238 static unsigned long window_memory_limit = 0;
239
240 -static struct list_objects_filter_options filter_options;
241 -
240 static struct string_list uri_protocols = STRING_LIST_INIT_NODUP;
241
242 enum missing_action {
@@ -3723,10 +3721,8 @@ static void get_object_list(struct rev_info *revs, int ac, const char **av)
3721 int flags = 0;
3722 int save_warning;
3723
3726 - repo_init_revisions(the_repository, revs, NULL);
3724 save_commit_buffer = 0;
3725 setup_revisions(ac, av, revs, &s_r_opt);
3729 - list_objects_filter_copy(&revs->filter, &filter_options);
3726
3727 /* make sure shallows are read */
3728 is_repository_shallow(the_repository);
@@ -3958,7 +3954,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
3954 &write_bitmap_index,
3955 N_("write a bitmap index if possible"),
3956 WRITE_BITMAP_QUIET, PARSE_OPT_HIDDEN),
3961 - OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
3957 + OPT_PARSE_LIST_OBJECTS_FILTER(&revs.filter),
3958 OPT_CALLBACK_F(0, "missing", NULL, N_("action"),
3959 N_("handling for missing objects"), PARSE_OPT_NONEG,
3960 option_parse_missing_action),
@@ -4080,7 +4076,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
4076 if (!rev_list_all || !rev_list_reflog || !rev_list_index)
4077 unpack_unreachable_expiration = 0;
4078
4083 - if (filter_options.choice) {
4079 + if (revs.filter.choice) {
4080 if (!pack_to_stdout)
4081 die(_("cannot use --filter without --stdout"));
4082 if (stdin_packs)