Skip to content

Commit 621603b

Browse files
author
Junio C Hamano
committed
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>
1 parent 2ae1c53 commit 621603b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apply.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static enum whitespace_eol {
3939
warn_on_whitespace,
4040
error_on_whitespace,
4141
strip_whitespace,
42-
} new_whitespace = nowarn_whitespace;
42+
} new_whitespace = warn_on_whitespace;
4343
static int whitespace_error = 0;
4444
static int squelch_whitespace_errors = 5;
4545
static int applied_after_stripping = 0;
@@ -48,13 +48,17 @@ static const char *patch_input_file = NULL;
4848
static void parse_whitespace_option(const char *option)
4949
{
5050
if (!option) {
51-
new_whitespace = nowarn_whitespace;
51+
new_whitespace = warn_on_whitespace;
5252
return;
5353
}
5454
if (!strcmp(option, "warn")) {
5555
new_whitespace = warn_on_whitespace;
5656
return;
5757
}
58+
if (!strcmp(option, "nowarn")) {
59+
new_whitespace = nowarn_whitespace;
60+
return;
61+
}
5862
if (!strcmp(option, "error")) {
5963
new_whitespace = error_on_whitespace;
6064
return;

0 commit comments

Comments
 (0)