@matheusbsbs / matheus-bagliano / commits / 621603b76a
Fork 0

git-apply --whitespace=nowarn

Andrew insists --whitespace=warn should be the default, and I tend to agree. This introduces --whitespace=warn, so if your project policy is more lenient, you can squelch them by having apply.whitespace=nowarn in your configuration file. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 27, 2006 at 17:07 UTC 621603b76afe00471613ce92b78376fc57f21234
1 file changed +6 -2
apply.c
+6 -2
@@ -39,7 +39,7 @@ static enum whitespace_eol {
39 warn_on_whitespace,
40 error_on_whitespace,
41 strip_whitespace,
42 -} new_whitespace = nowarn_whitespace;
42 +} new_whitespace = warn_on_whitespace;
43 static int whitespace_error = 0;
44 static int squelch_whitespace_errors = 5;
45 static int applied_after_stripping = 0;
@@ -48,13 +48,17 @@ static const char *patch_input_file = NULL;
48 static void parse_whitespace_option(const char *option)
49 {
50 if (!option) {
51 - new_whitespace = nowarn_whitespace;
51 + new_whitespace = warn_on_whitespace;
52 return;
53 }
54 if (!strcmp(option, "warn")) {
55 new_whitespace = warn_on_whitespace;
56 return;
57 }
58 + if (!strcmp(option, "nowarn")) {
59 + new_whitespace = nowarn_whitespace;
60 + return;
61 + }
62 if (!strcmp(option, "error")) {
63 new_whitespace = error_on_whitespace;
64 return;