summaryrefslogtreecommitdiff
path: root/builtin/apply.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2016-05-24 08:11:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-06-01 17:10:16 (GMT)
commit8bcba3d0d60d859c1494cdb59301cf84befcdfaa (patch)
tree0b920748ea7220d88a6ca1891f81c6a6e7545f2e /builtin/apply.c
parent161fcbe9884466e95cf5b1c7cd22f64a16a24045 (diff)
downloadgit-8bcba3d0d60d859c1494cdb59301cf84befcdfaa.zip
git-8bcba3d0d60d859c1494cdb59301cf84befcdfaa.tar.gz
git-8bcba3d0d60d859c1494cdb59301cf84befcdfaa.tar.bz2
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>
Diffstat (limited to 'builtin/apply.c')
-rw-r--r--builtin/apply.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index 78205f8..523ed74 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -132,10 +132,9 @@ static void parse_ignorewhitespace_option(const char *option)
die(_("unrecognized whitespace ignore option '%s'"), option);
}
-static void set_default_whitespace_mode(struct apply_state *state,
- const char *whitespace_option)
+static void set_default_whitespace_mode(struct apply_state *state)
{
- if (!whitespace_option && !apply_default_whitespace)
+ if (!state->whitespace_option && !apply_default_whitespace)
ws_error_action = (state->apply ? warn_on_ws_error : nowarn_ws_error);
}
@@ -4785,11 +4784,11 @@ int cmd_apply(int argc, const char **argv, const char *prefix)
if (fd < 0)
die_errno(_("can't open patch '%s'"), arg);
read_stdin = 0;
- set_default_whitespace_mode(&state, state.whitespace_option);
+ set_default_whitespace_mode(&state);
errs |= apply_patch(&state, fd, arg, options);
close(fd);
}
- set_default_whitespace_mode(&state, state.whitespace_option);
+ set_default_whitespace_mode(&state);
if (read_stdin)
errs |= apply_patch(&state, 0, "<stdin>", options);
if (state.whitespace_error) {