summaryrefslogtreecommitdiff
path: root/tree-diff.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-10-31 18:19:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-01 02:50:03 (GMT)
commit3b69daed861daec1923c369d59c97e46eb3c3d7b (patch)
treebc66d274c0b97aa27526320778387e557dc22dbe /tree-diff.c
parent25567af8056d992c9a51815db4b3a3e9417a2969 (diff)
downloadgit-3b69daed861daec1923c369d59c97e46eb3c3d7b.zip
git-3b69daed861daec1923c369d59c97e46eb3c3d7b.tar.gz
git-3b69daed861daec1923c369d59c97e46eb3c3d7b.tar.bz2
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 <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tree-diff.c b/tree-diff.c
index 4bb9315..ed0aa6a 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -212,9 +212,9 @@ static struct combine_diff_path *emit_path(struct combine_diff_path *p,
mode = 0;
}
- if (DIFF_OPT_TST(opt, RECURSIVE) && isdir) {
+ if (opt->flags.RECURSIVE && isdir) {
recurse = 1;
- emitthis = DIFF_OPT_TST(opt, TREE_IN_RECURSIVE);
+ emitthis = opt->flags.TREE_IN_RECURSIVE;
}
if (emitthis) {
@@ -425,7 +425,7 @@ static struct combine_diff_path *ll_diff_tree_paths(
ttree = fill_tree_descriptor(&t, oid);
/* Enable recursion indefinitely */
- opt->pathspec.recursive = DIFF_OPT_TST(opt, RECURSIVE);
+ opt->pathspec.recursive = opt->flags.RECURSIVE;
for (;;) {
int imin, cmp;
@@ -484,7 +484,7 @@ static struct combine_diff_path *ll_diff_tree_paths(
/* t = p[imin] */
if (cmp == 0) {
/* are either pi > p[imin] or diff(t,pi) != ø ? */
- if (!DIFF_OPT_TST(opt, FIND_COPIES_HARDER)) {
+ if (!opt->flags.FIND_COPIES_HARDER) {
for (i = 0; i < nparent; ++i) {
/* p[i] > p[imin] */
if (tp[i].entry.mode & S_IFXMIN_NEQ)
@@ -522,7 +522,7 @@ static struct combine_diff_path *ll_diff_tree_paths(
/* t > p[imin] */
else {
/* ∀i pi=p[imin] -> D += "-p[imin]" */
- if (!DIFF_OPT_TST(opt, FIND_COPIES_HARDER)) {
+ if (!opt->flags.FIND_COPIES_HARDER) {
for (i = 0; i < nparent; ++i)
if (tp[i].entry.mode & S_IFXMIN_NEQ)
goto skip_emit_tp;
@@ -706,7 +706,7 @@ int diff_tree_oid(const struct object_id *old_oid,
strbuf_addstr(&base, base_str);
retval = ll_diff_tree_oid(old_oid, new_oid, &base, opt);
- if (!*base_str && DIFF_OPT_TST(opt, FOLLOW_RENAMES) && diff_might_be_rename())
+ if (!*base_str && opt->flags.FOLLOW_RENAMES && diff_might_be_rename())
try_to_follow_renames(old_oid, new_oid, &base, opt);
strbuf_release(&base);