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>
Stefan Beller committed
Jan 4, 2018 at 14:50 UTC
4d8c51aa19be94bddb7cac6b11bccb4d23dfd4f8
1 file changed
+5
-10
diff.c
+5
-10
@@ -4107,20 +4107,15 @@ void diff_setup(struct diff_options *options)
4107
4108
void diff_setup_done(struct diff_options *options)
4109
{
4110
- int count = 0;
4110
+ unsigned check_mask = DIFF_FORMAT_NAME |
4111
+ DIFF_FORMAT_NAME_STATUS |
4112
+ DIFF_FORMAT_CHECKDIFF |
4113
+ DIFF_FORMAT_NO_OUTPUT;
4114
4115
if (options->set_default)
4116
options->set_default(options);
4117
4115
- if (options->output_format & DIFF_FORMAT_NAME)
4116
- count++;
4117
- if (options->output_format & DIFF_FORMAT_NAME_STATUS)
4118
- count++;
4119
- if (options->output_format & DIFF_FORMAT_CHECKDIFF)
4120
- count++;
4121
- if (options->output_format & DIFF_FORMAT_NO_OUTPUT)
4122
- count++;
4123
- if (count > 1)
4118
+ if (HAS_MULTI_BITS(options->output_format & check_mask))
4119
die(_("--name-only, --name-status, --check and -s are mutually exclusive"));
4120
4121
if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK))