Skip to content

Commit 831ee25

Browse files
derrickstoleegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 80f6de4 commit 831ee25

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

builtin/pack-objects.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ static unsigned long cache_max_small_delta_size = 1000;
237237

238238
static unsigned long window_memory_limit = 0;
239239

240-
static struct list_objects_filter_options filter_options;
241-
242240
static struct string_list uri_protocols = STRING_LIST_INIT_NODUP;
243241

244242
enum missing_action {
@@ -3723,10 +3721,8 @@ static void get_object_list(struct rev_info *revs, int ac, const char **av)
37233721
int flags = 0;
37243722
int save_warning;
37253723

3726-
repo_init_revisions(the_repository, revs, NULL);
37273724
save_commit_buffer = 0;
37283725
setup_revisions(ac, av, revs, &s_r_opt);
3729-
list_objects_filter_copy(&revs->filter, &filter_options);
37303726

37313727
/* make sure shallows are read */
37323728
is_repository_shallow(the_repository);
@@ -3958,7 +3954,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
39583954
&write_bitmap_index,
39593955
N_("write a bitmap index if possible"),
39603956
WRITE_BITMAP_QUIET, PARSE_OPT_HIDDEN),
3961-
OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
3957+
OPT_PARSE_LIST_OBJECTS_FILTER(&revs.filter),
39623958
OPT_CALLBACK_F(0, "missing", NULL, N_("action"),
39633959
N_("handling for missing objects"), PARSE_OPT_NONEG,
39643960
option_parse_missing_action),
@@ -4080,7 +4076,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
40804076
if (!rev_list_all || !rev_list_reflog || !rev_list_index)
40814077
unpack_unreachable_expiration = 0;
40824078

4083-
if (filter_options.choice) {
4079+
if (revs.filter.choice) {
40844080
if (!pack_to_stdout)
40854081
die(_("cannot use --filter without --stdout"));
40864082
if (stdin_packs)

0 commit comments

Comments
 (0)