Move all the setting code related to diffing merges into new setup_diff_merge_revs() function. Signed-off-by: Sergey Organov <sorganov@xxxxxxxxx> --- revision.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/revision.c b/revision.c index 8b17cfd754fe..d818e0b18bbc 100644 --- a/revision.c +++ b/revision.c @@ -2192,6 +2192,16 @@ static int parse_diff_merge_opts(struct rev_info *revs, const char **argv) return argcount; } +static void setup_diff_merges_revs(struct rev_info *revs) +{ + if (revs->combine_merges && revs->ignore_merges < 0) + revs->ignore_merges = 0; + if (revs->ignore_merges < 0) + revs->ignore_merges = 1; + if (revs->combined_all_paths && !revs->combine_merges) + die("--combined-all-paths makes no sense without -c or --cc"); +} + static int handle_revision_opt(struct rev_info *revs, int argc, const char **argv, int *unkc, const char **unkv, const struct setup_revision_opt* opt) @@ -2886,12 +2896,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s copy_pathspec(&revs->diffopt.pathspec, &revs->prune_data); } - if (revs->combine_merges && revs->ignore_merges < 0) - revs->ignore_merges = 0; - if (revs->ignore_merges < 0) - revs->ignore_merges = 1; - if (revs->combined_all_paths && !revs->combine_merges) - die("--combined-all-paths makes no sense without -c or --cc"); + + setup_diff_merges_revs(revs); revs->diffopt.abbrev = revs->abbrev; -- 2.25.1