builtin/apply: remove whitespace_option arg from set_default_whitespace_mode()
A previous change has move the whitespace_option variable from cmd_apply into 'struct apply_state', so that we can now avoid passing it separately to set_default_whitespace_mode(). Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
May 24, 2016 at 10:11 UTC
8bcba3d0d60d859c1494cdb59301cf84befcdfaa
1 file changed
+4
-5
builtin/apply.c
+4
-5
@@ -132,10 +132,9 @@ static void parse_ignorewhitespace_option(const char *option)
132
die(_("unrecognized whitespace ignore option '%s'"), option);
133
}
134
135
-static void set_default_whitespace_mode(struct apply_state *state,
136
- const char *whitespace_option)
135
+static void set_default_whitespace_mode(struct apply_state *state)
136
{
138
- if (!whitespace_option && !apply_default_whitespace)
137
+ if (!state->whitespace_option && !apply_default_whitespace)
138
ws_error_action = (state->apply ? warn_on_ws_error : nowarn_ws_error);
139
}
140
@@ -4785,11 +4784,11 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
4784
if (fd < 0)
4785
die_errno(_("can't open patch '%s'"), arg);
4786
read_stdin = 0;
4788
- set_default_whitespace_mode(&state, state.whitespace_option);
4787
+ set_default_whitespace_mode(&state);
4788
errs |= apply_patch(&state, fd, arg, options);
4789
close(fd);
4790
}
4792
- set_default_whitespace_mode(&state, state.whitespace_option);
4791
+ set_default_whitespace_mode(&state);
4792
if (read_stdin)
4793
errs |= apply_patch(&state, 0, "<stdin>", options);
4794
if (state.whitespace_error) {