diff: remove DIFF_OPT_SET macro
Remove the `DIFF_OPT_SET` macro and instead set the flags directly. This conversion is done using the following semantic patch: @@ expression E; identifier fld; @@ - DIFF_OPT_SET(&E, fld) + E.flags.fld = 1 @@ type T; T *ptr; identifier fld; @@ - DIFF_OPT_SET(ptr, fld) + ptr->flags.fld = 1 Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
3b69daed86
commit
23dcf77f48
@ -183,7 +183,7 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
|
||||
if (ignore)
|
||||
handle_ignore_submodules_arg(diffopt, ignore);
|
||||
else if (is_gitmodules_unmerged(&the_index))
|
||||
DIFF_OPT_SET(diffopt, IGNORE_SUBMODULES);
|
||||
diffopt->flags.IGNORE_SUBMODULES = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,11 +407,11 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt,
|
||||
DIFF_OPT_CLR(diffopt, IGNORE_DIRTY_SUBMODULES);
|
||||
|
||||
if (!strcmp(arg, "all"))
|
||||
DIFF_OPT_SET(diffopt, IGNORE_SUBMODULES);
|
||||
diffopt->flags.IGNORE_SUBMODULES = 1;
|
||||
else if (!strcmp(arg, "untracked"))
|
||||
DIFF_OPT_SET(diffopt, IGNORE_UNTRACKED_IN_SUBMODULES);
|
||||
diffopt->flags.IGNORE_UNTRACKED_IN_SUBMODULES = 1;
|
||||
else if (!strcmp(arg, "dirty"))
|
||||
DIFF_OPT_SET(diffopt, IGNORE_DIRTY_SUBMODULES);
|
||||
diffopt->flags.IGNORE_DIRTY_SUBMODULES = 1;
|
||||
else if (strcmp(arg, "none"))
|
||||
die("bad --ignore-submodules argument: %s", arg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user