Skip to content

Commit da8e30d

Browse files
chriscoolgitster
authored andcommitted
builtin/apply: rename option parsing functions
As these functions are going to be part of the libified apply API, let's give them a name that is more specific to the apply API. Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 603752a commit da8e30d

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

builtin/apply.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4588,35 +4588,35 @@ static int apply_patch(struct apply_state *state,
45884588
return res;
45894589
}
45904590

4591-
static int option_parse_exclude(const struct option *opt,
4592-
const char *arg, int unset)
4591+
static int apply_option_parse_exclude(const struct option *opt,
4592+
const char *arg, int unset)
45934593
{
45944594
struct apply_state *state = opt->value;
45954595
add_name_limit(state, arg, 1);
45964596
return 0;
45974597
}
45984598

4599-
static int option_parse_include(const struct option *opt,
4600-
const char *arg, int unset)
4599+
static int apply_option_parse_include(const struct option *opt,
4600+
const char *arg, int unset)
46014601
{
46024602
struct apply_state *state = opt->value;
46034603
add_name_limit(state, arg, 0);
46044604
state->has_include = 1;
46054605
return 0;
46064606
}
46074607

4608-
static int option_parse_p(const struct option *opt,
4609-
const char *arg,
4610-
int unset)
4608+
static int apply_option_parse_p(const struct option *opt,
4609+
const char *arg,
4610+
int unset)
46114611
{
46124612
struct apply_state *state = opt->value;
46134613
state->p_value = atoi(arg);
46144614
state->p_value_known = 1;
46154615
return 0;
46164616
}
46174617

4618-
static int option_parse_space_change(const struct option *opt,
4619-
const char *arg, int unset)
4618+
static int apply_option_parse_space_change(const struct option *opt,
4619+
const char *arg, int unset)
46204620
{
46214621
struct apply_state *state = opt->value;
46224622
if (unset)
@@ -4626,8 +4626,8 @@ static int option_parse_space_change(const struct option *opt,
46264626
return 0;
46274627
}
46284628

4629-
static int option_parse_whitespace(const struct option *opt,
4630-
const char *arg, int unset)
4629+
static int apply_option_parse_whitespace(const struct option *opt,
4630+
const char *arg, int unset)
46314631
{
46324632
struct apply_state *state = opt->value;
46334633
state->whitespace_option = arg;
@@ -4636,8 +4636,8 @@ static int option_parse_whitespace(const struct option *opt,
46364636
return 0;
46374637
}
46384638

4639-
static int option_parse_directory(const struct option *opt,
4640-
const char *arg, int unset)
4639+
static int apply_option_parse_directory(const struct option *opt,
4640+
const char *arg, int unset)
46414641
{
46424642
struct apply_state *state = opt->value;
46434643
strbuf_reset(&state->root);
@@ -4755,13 +4755,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
47554755
struct option builtin_apply_options[] = {
47564756
{ OPTION_CALLBACK, 0, "exclude", &state, N_("path"),
47574757
N_("don't apply changes matching the given path"),
4758-
0, option_parse_exclude },
4758+
0, apply_option_parse_exclude },
47594759
{ OPTION_CALLBACK, 0, "include", &state, N_("path"),
47604760
N_("apply changes matching the given path"),
4761-
0, option_parse_include },
4761+
0, apply_option_parse_include },
47624762
{ OPTION_CALLBACK, 'p', NULL, &state, N_("num"),
47634763
N_("remove <num> leading slashes from traditional diff paths"),
4764-
0, option_parse_p },
4764+
0, apply_option_parse_p },
47654765
OPT_BOOL(0, "no-add", &state.no_add,
47664766
N_("ignore additions made by the patch")),
47674767
OPT_BOOL(0, "stat", &state.diffstat,
@@ -4793,13 +4793,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
47934793
N_("ensure at least <n> lines of context match")),
47944794
{ OPTION_CALLBACK, 0, "whitespace", &state, N_("action"),
47954795
N_("detect new or modified lines that have whitespace errors"),
4796-
0, option_parse_whitespace },
4796+
0, apply_option_parse_whitespace },
47974797
{ OPTION_CALLBACK, 0, "ignore-space-change", &state, NULL,
47984798
N_("ignore changes in whitespace when finding context"),
4799-
PARSE_OPT_NOARG, option_parse_space_change },
4799+
PARSE_OPT_NOARG, apply_option_parse_space_change },
48004800
{ OPTION_CALLBACK, 0, "ignore-whitespace", &state, NULL,
48014801
N_("ignore changes in whitespace when finding context"),
4802-
PARSE_OPT_NOARG, option_parse_space_change },
4802+
PARSE_OPT_NOARG, apply_option_parse_space_change },
48034803
OPT_BOOL('R', "reverse", &state.apply_in_reverse,
48044804
N_("apply the patch in reverse")),
48054805
OPT_BOOL(0, "unidiff-zero", &state.unidiff_zero,
@@ -4817,7 +4817,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
48174817
RECOUNT),
48184818
{ OPTION_CALLBACK, 0, "directory", &state, N_("root"),
48194819
N_("prepend <root> to all filenames"),
4820-
0, option_parse_directory },
4820+
0, apply_option_parse_directory },
48214821
OPT_END()
48224822
};
48234823

0 commit comments

Comments
 (0)