list-objects-filter: remove CL_ARG__FILTER

We have established the command-line interface for the --[no-]filter
options for a while now, so we do not need a helper to make this
editable in the future.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Derrick Stolee 2022-03-22 17:28:35 +00:00 committed by Junio C Hamano
parent f01e51a7cf
commit cc91044256
3 changed files with 5 additions and 8 deletions

View file

@ -153,11 +153,11 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
args.from_promisor = 1; args.from_promisor = 1;
continue; continue;
} }
if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) { if (skip_prefix(arg, ("--filter="), &arg)) {
parse_list_objects_filter(&args.filter_options, arg); parse_list_objects_filter(&args.filter_options, arg);
continue; continue;
} }
if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) { if (!strcmp(arg, ("--no-filter"))) {
list_objects_filter_set_no_filter(&args.filter_options); list_objects_filter_set_no_filter(&args.filter_options);
continue; continue;
} }

View file

@ -69,9 +69,6 @@ struct list_objects_filter_options {
*/ */
}; };
/* Normalized command line arguments */
#define CL_ARG__FILTER "filter"
/* /*
* Parse value of the argument to the "filter" keyword. * Parse value of the argument to the "filter" keyword.
* On the command line this looks like: * On the command line this looks like:
@ -111,7 +108,7 @@ int opt_parse_list_objects_filter(const struct option *opt,
const char *arg, int unset); const char *arg, int unset);
#define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \ #define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \
OPT_CALLBACK(0, CL_ARG__FILTER, fo, N_("args"), \ OPT_CALLBACK(0, "filter", fo, N_("args"), \
N_("object filtering"), \ N_("object filtering"), \
opt_parse_list_objects_filter) opt_parse_list_objects_filter)

View file

@ -2691,9 +2691,9 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
revs->no_walk = 0; revs->no_walk = 0;
} else if (!strcmp(arg, "--single-worktree")) { } else if (!strcmp(arg, "--single-worktree")) {
revs->single_worktree = 1; revs->single_worktree = 1;
} else if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) { } else if (skip_prefix(arg, ("--filter="), &arg)) {
parse_list_objects_filter(&revs->filter, arg); parse_list_objects_filter(&revs->filter, arg);
} else if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) { } else if (!strcmp(arg, ("--no-filter"))) {
list_objects_filter_set_no_filter(&revs->filter); list_objects_filter_set_no_filter(&revs->filter);
} else { } else {
return 0; return 0;