Skip to content

Commit cc91044

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

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

builtin/fetch-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
153153
args.from_promisor = 1;
154154
continue;
155155
}
156-
if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {
156+
if (skip_prefix(arg, ("--filter="), &arg)) {
157157
parse_list_objects_filter(&args.filter_options, arg);
158158
continue;
159159
}
160-
if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) {
160+
if (!strcmp(arg, ("--no-filter"))) {
161161
list_objects_filter_set_no_filter(&args.filter_options);
162162
continue;
163163
}

list-objects-filter-options.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ struct list_objects_filter_options {
6969
*/
7070
};
7171

72-
/* Normalized command line arguments */
73-
#define CL_ARG__FILTER "filter"
74-
7572
/*
7673
* Parse value of the argument to the "filter" keyword.
7774
* On the command line this looks like:
@@ -111,7 +108,7 @@ int opt_parse_list_objects_filter(const struct option *opt,
111108
const char *arg, int unset);
112109

113110
#define OPT_PARSE_LIST_OBJECTS_FILTER(fo) \
114-
OPT_CALLBACK(0, CL_ARG__FILTER, fo, N_("args"), \
111+
OPT_CALLBACK(0, "filter", fo, N_("args"), \
115112
N_("object filtering"), \
116113
opt_parse_list_objects_filter)
117114

revision.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,9 +2691,9 @@ static int handle_revision_pseudo_opt(struct rev_info *revs,
26912691
revs->no_walk = 0;
26922692
} else if (!strcmp(arg, "--single-worktree")) {
26932693
revs->single_worktree = 1;
2694-
} else if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {
2694+
} else if (skip_prefix(arg, ("--filter="), &arg)) {
26952695
parse_list_objects_filter(&revs->filter, arg);
2696-
} else if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) {
2696+
} else if (!strcmp(arg, ("--no-filter"))) {
26972697
list_objects_filter_set_no_filter(&revs->filter);
26982698
} else {
26992699
return 0;

0 commit comments

Comments
 (0)