summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5c0d46e)
raw | patch | inline | side by side (parent: 5c0d46e)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 28 Feb 2006 09:12:52 +0000 (01:12 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 28 Feb 2006 09:17:14 +0000 (01:17 -0800) |
This changes the default --whitespace policy to nowarn when we
are only getting --stat, --summary etc. IOW when not applying
the patch. When applying the patch, the default is warn (spit
out warning message but apply the patch).
Signed-off-by: Junio C Hamano <junkio@cox.net>
are only getting --stat, --summary etc. IOW when not applying
the patch. When applying the patch, the default is warn (spit
out warning message but apply the patch).
Signed-off-by: Junio C Hamano <junkio@cox.net>
apply.c | patch | blob | history |
index af9900ff1e8281e9a1d1c4b2ec98e6408ae49027..453482a035d76a14b04fa4182694a3d46db083e7 100644 (file)
--- a/apply.c
+++ b/apply.c
die("unrecognized whitespace option '%s'", option);
}
+static void set_default_whitespace_mode(const char *whitespace_option)
+{
+ if (!whitespace_option && !apply_default_whitespace) {
+ new_whitespace = (apply
+ ? warn_on_whitespace
+ : nowarn_whitespace);
+ }
+}
+
/*
* For "diff-stat" like behaviour, we keep track of the biggest change
* we've seen, and the longest filename. That allows us to do simple
if (fd < 0)
usage(apply_usage);
read_stdin = 0;
+ set_default_whitespace_mode(whitespace_option);
apply_patch(fd, arg);
close(fd);
}
+ set_default_whitespace_mode(whitespace_option);
if (read_stdin)
apply_patch(0, "<stdin>");
if (whitespace_error) {