summaryrefslogtreecommitdiff
path: root/tree-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-09 05:31:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-11-09 05:31:27 (GMT)
commit8cc633286a4803025d84b77c808a2c7ad8616f2f (patch)
tree624047e4917cd5113dad8f487dd8dec21985c775 /tree-diff.c
parentbde13700105a1c945819578ce8d5c0627d52c741 (diff)
parent0d1e0e7801bb2ae22036ad09f9f5cec17e08c48b (diff)
downloadgit-8cc633286a4803025d84b77c808a2c7ad8616f2f.zip
git-8cc633286a4803025d84b77c808a2c7ad8616f2f.tar.gz
git-8cc633286a4803025d84b77c808a2c7ad8616f2f.tar.bz2
Merge branch 'bw/diff-opt-impl-to-bitfields'
A single-word "unsigned flags" in the diff options is being split into a structure with many bitfields. * bw/diff-opt-impl-to-bitfields: diff: make struct diff_flags members lowercase diff: remove DIFF_OPT_CLR macro diff: remove DIFF_OPT_SET macro diff: remove DIFF_OPT_TST macro diff: remove touched flags diff: add flag to indicate textconv was set via cmdline diff: convert flags to be stored in bitfields add, reset: use DIFF_OPT_SET macro to set a diff flag
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tree-diff.c b/tree-diff.c
index 4bb9315..fe2e466 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;
@@ -608,8 +608,8 @@ static void try_to_follow_renames(const struct object_id *old_oid,
q->nr = 0;
diff_setup(&diff_opts);
- DIFF_OPT_SET(&diff_opts, RECURSIVE);
- DIFF_OPT_SET(&diff_opts, FIND_COPIES_HARDER);
+ diff_opts.flags.recursive = 1;
+ diff_opts.flags.find_copies_harder = 1;
diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;
diff_opts.single_follow = opt->pathspec.items[0].match;
diff_opts.break_opt = opt->break_opt;
@@ -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);