summaryrefslogtreecommitdiff
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorLibravatar Sergey Organov <sorganov@gmail.com>2020-12-21 18:19:39 +0300
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-12-21 13:47:31 -0800
commit3b6c17b5c0bd126e3c712f5de909a033d99f1e3a (patch)
treeae28287b99d1f72a2edcd1c99943a3473bbd5efa /builtin/diff.c
parentdiff-merges: new function diff_merges_suppress() (diff)
downloadtgif-3b6c17b5c0bd126e3c712f5de909a033d99f1e3a.tar.xz
diff-merges: new function diff_merges_set_dense_combined_if_unset()
Call it where given functionality is needed instead of direct checking/tweaking of diff merges related fields. Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/diff.c')
-rw-r--r--builtin/diff.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index cd4083fed9..2f570a3131 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -13,6 +13,7 @@
#include "blob.h"
#include "tag.h"
#include "diff.h"
+#include "diff-merges.h"
#include "diffcore.h"
#include "revision.h"
#include "log-tree.h"
@@ -199,8 +200,8 @@ static int builtin_diff_combined(struct rev_info *revs,
if (argc > 1)
usage(builtin_diff_usage);
- if (!revs->dense_combined_merges && !revs->combine_merges)
- revs->dense_combined_merges = revs->combine_merges = 1;
+ diff_merges_set_dense_combined_if_unset(revs);
+
for (i = 1; i < ents; i++)
oid_array_append(&parents, &ent[i].item->oid);
diff_tree_combined(&ent[0].item->oid, &parents, revs);
@@ -248,9 +249,9 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
* dense one, --cc can be explicitly asked for, or just rely
* on the default).
*/
- if (revs->max_count == -1 && !revs->combine_merges &&
+ if (revs->max_count == -1 &&
(revs->diffopt.output_format & DIFF_FORMAT_PATCH))
- revs->combine_merges = revs->dense_combined_merges = 1;
+ diff_merges_set_dense_combined_if_unset(revs);
setup_work_tree();
if (read_cache_preload(&revs->diffopt.pathspec) < 0) {