summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-01-04 22:50:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-04 23:02:40 (GMT)
commit4d8c51aa19be94bddb7cac6b11bccb4d23dfd4f8 (patch)
tree0faa3959b05341e99a8c77038c70304c6797a1ad /diff.c
parent5e505257f2651647c072f9c61fdc5dd52bbce8b2 (diff)
downloadgit-4d8c51aa19be94bddb7cac6b11bccb4d23dfd4f8.zip
git-4d8c51aa19be94bddb7cac6b11bccb4d23dfd4f8.tar.gz
git-4d8c51aa19be94bddb7cac6b11bccb4d23dfd4f8.tar.bz2
diff: use HAS_MULTI_BITS instead of counting bits manually
This aligns the style to the previous patch. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/diff.c b/diff.c
index 42858d4..c2ee81a 100644
--- a/diff.c
+++ b/diff.c
@@ -4107,20 +4107,15 @@ void diff_setup(struct diff_options *options)
void diff_setup_done(struct diff_options *options)
{
- int count = 0;
+ unsigned check_mask = DIFF_FORMAT_NAME |
+ DIFF_FORMAT_NAME_STATUS |
+ DIFF_FORMAT_CHECKDIFF |
+ DIFF_FORMAT_NO_OUTPUT;
if (options->set_default)
options->set_default(options);
- 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)
+ if (HAS_MULTI_BITS(options->output_format & check_mask))
die(_("--name-only, --name-status, --check and -s are mutually exclusive"));
if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK))