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 <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Sep 4, 2016 at 22:18 UTC
da8e30dcd96f75eac9a343f973198242b44a1ca9
1 file changed
+20
-20
builtin/apply.c
+20
-20
@@ -4588,16 +4588,16 @@ end:
4588
return res;
4589
}
4590
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)
4593
{
4594
struct apply_state *state = opt->value;
4595
add_name_limit(state, arg, 1);
4596
return 0;
4597
}
4598
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)
4601
{
4602
struct apply_state *state = opt->value;
4603
add_name_limit(state, arg, 0);
@@ -4605,9 +4605,9 @@ static int option_parse_include(const struct option *opt,
4605
return 0;
4606
}
4607
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)
4611
{
4612
struct apply_state *state = opt->value;
4613
state->p_value = atoi(arg);
@@ -4615,8 +4615,8 @@ static int option_parse_p(const struct option *opt,
4615
return 0;
4616
}
4617
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)
4620
{
4621
struct apply_state *state = opt->value;
4622
if (unset)
@@ -4626,8 +4626,8 @@ static int option_parse_space_change(const struct option *opt,
4626
return 0;
4627
}
4628
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)
4631
{
4632
struct apply_state *state = opt->value;
4633
state->whitespace_option = arg;
@@ -4636,8 +4636,8 @@ static int option_parse_whitespace(const struct option *opt,
4636
return 0;
4637
}
4638
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)
4641
{
4642
struct apply_state *state = opt->value;
4643
strbuf_reset(&state->root);
@@ -4755,13 +4755,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
4755
struct option builtin_apply_options[] = {
4756
{ OPTION_CALLBACK, 0, "exclude", &state, N_("path"),
4757
N_("don't apply changes matching the given path"),
4758
- 0, option_parse_exclude },
4758
+ 0, apply_option_parse_exclude },
4759
{ OPTION_CALLBACK, 0, "include", &state, N_("path"),
4760
N_("apply changes matching the given path"),
4761
- 0, option_parse_include },
4761
+ 0, apply_option_parse_include },
4762
{ OPTION_CALLBACK, 'p', NULL, &state, N_("num"),
4763
N_("remove <num> leading slashes from traditional diff paths"),
4764
- 0, option_parse_p },
4764
+ 0, apply_option_parse_p },
4765
OPT_BOOL(0, "no-add", &state.no_add,
4766
N_("ignore additions made by the patch")),
4767
OPT_BOOL(0, "stat", &state.diffstat,
@@ -4793,13 +4793,13 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
4793
N_("ensure at least <n> lines of context match")),
4794
{ OPTION_CALLBACK, 0, "whitespace", &state, N_("action"),
4795
N_("detect new or modified lines that have whitespace errors"),
4796
- 0, option_parse_whitespace },
4796
+ 0, apply_option_parse_whitespace },
4797
{ OPTION_CALLBACK, 0, "ignore-space-change", &state, NULL,
4798
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 },
4800
{ OPTION_CALLBACK, 0, "ignore-whitespace", &state, NULL,
4801
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 },
4803
OPT_BOOL('R', "reverse", &state.apply_in_reverse,
4804
N_("apply the patch in reverse")),
4805
OPT_BOOL(0, "unidiff-zero", &state.unidiff_zero,
@@ -4817,7 +4817,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
4817
RECOUNT),
4818
{ OPTION_CALLBACK, 0, "directory", &state, N_("root"),
4819
N_("prepend <root> to all filenames"),
4820
- 0, option_parse_directory },
4820
+ 0, apply_option_parse_directory },
4821
OPT_END()
4822
};
4823