Make the diff_options bitfields be an unsigned with explicit masks.
reverse_diff was a bit-value in disguise, it's merged in the flags now. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
68dce6e941
commit
8f67f8aefb
@ -35,7 +35,7 @@ static void stuff_change(struct diff_options *opt,
|
||||
!hashcmp(old_sha1, new_sha1) && (old_mode == new_mode))
|
||||
return;
|
||||
|
||||
if (opt->reverse_diff) {
|
||||
if (DIFF_OPT_TST(opt, REVERSE_DIFF)) {
|
||||
unsigned tmp;
|
||||
const unsigned char *tmp_u;
|
||||
const char *tmp_c;
|
||||
@ -253,13 +253,13 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
|
||||
if (diff_setup_done(&rev.diffopt) < 0)
|
||||
die("diff_setup_done failed");
|
||||
}
|
||||
rev.diffopt.allow_external = 1;
|
||||
rev.diffopt.recursive = 1;
|
||||
DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
|
||||
DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
|
||||
|
||||
/* If the user asked for our exit code then don't start a
|
||||
* pager or we would end up reporting its exit code instead.
|
||||
*/
|
||||
if (!rev.diffopt.exit_with_status)
|
||||
if (!DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS))
|
||||
setup_pager();
|
||||
|
||||
/* Do we have --cached and not have a pending object, then
|
||||
@ -363,8 +363,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
|
||||
else
|
||||
result = builtin_diff_combined(&rev, argc, argv,
|
||||
ent, ents);
|
||||
if (rev.diffopt.exit_with_status)
|
||||
result = rev.diffopt.has_changes;
|
||||
if (DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS))
|
||||
result = DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES) != 0;
|
||||
|
||||
if (1 < rev.diffopt.skip_stat_unmatch)
|
||||
refresh_index_quietly();
|
||||
|
||||
Reference in New Issue
Block a user