Merge branch 'maint'
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index a8710cb9e2388ce915fabc99cb86caacd1020961..8861b853e70ab511fdcab16d97687aafc99ec000 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1679,6 +1679,19 @@ void diff_setup(struct diff_options *options)
 
 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;