Code

--name-only, --name-status, --check and -s are mutually exclusive
authorTimo Hirvonen <tihirvon@gmail.com>
Sat, 24 Jun 2006 17:26:49 +0000 (20:26 +0300)
committerJunio C Hamano <junkio@cox.net>
Sun, 2 Jul 2006 05:26:00 +0000 (22:26 -0700)
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c

diff --git a/diff.c b/diff.c
index 1c131ff4dcdab52abec6f182e1a9310820532189..5358fd0c14a249c2d1a3fe417016264aba6fc745 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1433,6 +1433,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) ||
            (0 <= options->rename_limit && !options->detect_rename))