diff options
author | Sergey Organov <sorganov@gmail.com> | 2020-12-21 16:19:39 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-21 22:47:31 +0100 |
commit | 3b6c17b5c0bd126e3c712f5de909a033d99f1e3a (patch) | |
tree | ae28287b99d1f72a2edcd1c99943a3473bbd5efa /diff-merges.c | |
parent | diff-merges: new function diff_merges_suppress() (diff) | |
download | git-3b6c17b5c0bd126e3c712f5de909a033d99f1e3a.tar.xz git-3b6c17b5c0bd126e3c712f5de909a033d99f1e3a.zip |
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 'diff-merges.c')
-rw-r--r-- | diff-merges.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/diff-merges.c b/diff-merges.c index 23e6cb11d1..24f922cf8a 100644 --- a/diff-merges.c +++ b/diff-merges.c @@ -10,6 +10,13 @@ static void suppress(struct rev_info *revs) revs->dense_combined_merges = 0; } +static void set_dense_combined(struct rev_info *revs) +{ + revs->combine_merges = 1; + revs->dense_combined_merges = 1; +} + + /* * Public functions. They are in the order they are called. */ @@ -39,8 +46,7 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv) revs->combine_merges = 1; } else if (!strcmp(arg, "--cc")) { revs->diff = 1; - revs->dense_combined_merges = 1; - revs->combine_merges = 1; + set_dense_combined(revs); } else if (!strcmp(arg, "--no-diff-merges")) { suppress(revs); } else if (!strcmp(arg, "--combined-all-paths")) { @@ -80,6 +86,12 @@ void diff_merges_default_to_dense_combined(struct rev_info *revs) } } +void diff_merges_set_dense_combined_if_unset(struct rev_info *revs) +{ + if (!revs->combine_merges) + set_dense_combined(revs); +} + void diff_merges_setup_revs(struct rev_info *revs) { if (revs->combine_merges && revs->ignore_merges < 0) |