summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-28 01:07:16 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-28 01:34:26 (GMT)
commit621603b76afe00471613ce92b78376fc57f21234 (patch)
tree06ff1c11ee6d1f1ede5d56acc42eba0f16d93515 /apply.c
parent2ae1c53b51ff78b13cc8abf8e9798a12140b7638 (diff)
downloadgit-621603b76afe00471613ce92b78376fc57f21234.zip
git-621603b76afe00471613ce92b78376fc57f21234.tar.gz
git-621603b76afe00471613ce92b78376fc57f21234.tar.bz2
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>
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apply.c b/apply.c
index a5cdd8e..c4ff418 100644
--- a/apply.c
+++ b/apply.c
@@ -39,7 +39,7 @@ static enum whitespace_eol {
warn_on_whitespace,
error_on_whitespace,
strip_whitespace,
-} new_whitespace = nowarn_whitespace;
+} new_whitespace = warn_on_whitespace;
static int whitespace_error = 0;
static int squelch_whitespace_errors = 5;
static int applied_after_stripping = 0;
@@ -48,13 +48,17 @@ static const char *patch_input_file = NULL;
static void parse_whitespace_option(const char *option)
{
if (!option) {
- new_whitespace = nowarn_whitespace;
+ new_whitespace = warn_on_whitespace;
return;
}
if (!strcmp(option, "warn")) {
new_whitespace = warn_on_whitespace;
return;
}
+ if (!strcmp(option, "nowarn")) {
+ new_whitespace = nowarn_whitespace;
+ return;
+ }
if (!strcmp(option, "error")) {
new_whitespace = error_on_whitespace;
return;