From 3b69daed861daec1923c369d59c97e46eb3c3d7b Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Tue, 31 Oct 2017 11:19:08 -0700 Subject: diff: remove DIFF_OPT_TST macro Remove the `DIFF_OPT_TST` macro and instead access the flags directly. This conversion is done using the following semantic patch: @@ expression E; identifier fld; @@ - DIFF_OPT_TST(&E, fld) + E.flags.fld @@ type T; T *ptr; identifier fld; @@ - DIFF_OPT_TST(ptr, fld) + ptr->flags.fld Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- combine-diff.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'combine-diff.c') diff --git a/combine-diff.c b/combine-diff.c index 9e163d5ada..40cb4dd1a5 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -898,7 +898,7 @@ static void show_combined_header(struct combine_diff_path *elem, int show_file_header) { struct diff_options *opt = &rev->diffopt; - int abbrev = DIFF_OPT_TST(opt, FULL_INDEX) ? GIT_SHA1_HEXSZ : DEFAULT_ABBREV; + int abbrev = opt->flags.FULL_INDEX ? GIT_SHA1_HEXSZ : DEFAULT_ABBREV; const char *a_prefix = opt->a_prefix ? opt->a_prefix : "a/"; const char *b_prefix = opt->b_prefix ? opt->b_prefix : "b/"; const char *c_meta = diff_get_color_opt(opt, DIFF_METAINFO); @@ -987,7 +987,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, userdiff = userdiff_find_by_path(elem->path); if (!userdiff) userdiff = userdiff_find_by_name("default"); - if (DIFF_OPT_TST(opt, ALLOW_TEXTCONV)) + if (opt->flags.ALLOW_TEXTCONV) textconv = userdiff_get_textconv(userdiff); /* Read the result of merge first */ @@ -1435,7 +1435,7 @@ void diff_tree_combined(const struct object_id *oid, * NOTE please keep this semantically in sync with diffcore_std() */ need_generic_pathscan = opt->skip_stat_unmatch || - DIFF_OPT_TST(opt, FOLLOW_RENAMES) || + opt->flags.FOLLOW_RENAMES || opt->break_opt != -1 || opt->detect_rename || opt->pickaxe || -- cgit v1.2.3