Thread (14 messages) flat view 14 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH 6/7] --name-only, --name-status, --check and -s are mutually exclusive

From: Timo Hirvonen <hidden>
Date: 2016-06-15 22:42:31
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Timo Hirvonen <redacted>
---
 diff.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 6be31e7..4b1b4eb 100644
--- a/diff.c
+++ b/diff.c
@@ -1366,6 +1366,19 @@ void diff_setup(struct diff_options *opt
 
 int diff_setup_done(struct diff_options *options)
 {
+	int count = 0;
+
+	if (options->output_format & DIFF_FORMAT_NAME)
+		count++;
+	if (options->output_format & DIFF_FORMAT_NAME_STATUS)
+		count++;
+	if (options->output_format & DIFF_FORMAT_CHECKDIFF)
+		count++;
+	if (options->output_format & DIFF_FORMAT_NO_OUTPUT)
+		count++;
+	if (count > 1)
+		die("--name-only, --name-status, --check and -s are mutually exclusive");
+
 	if ((options->find_copies_harder &&
 	     options->detect_rename != DIFF_DETECT_COPY) ||
 	    (0 <= options->rename_limit && !options->detect_rename))
-- 
1.4.1.rc1.g8637
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help