Sergey Organov <sorganov@xxxxxxxxx> writes: > 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(-) Looks trivially correct. > diff --git a/revision.c b/revision.c > index a09f4872acd7..739295bb9ff4 100644 > --- a/revision.c > +++ b/revision.c > @@ -2191,6 +2191,16 @@ static int parse_diff_merge_opts(struct rev_info *revs, const char **argv) { > return 1; > } > > +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) > @@ -2885,12 +2895,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;