diff-merges: introduce revs->first_parent_merges flag

This new field allows us to separate format of diff for merges from
'first_parent_only' flag which primary purpose is limiting history
traversal.

This change further localizes diff format selection logic into the
diff-merges.c file.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Sergey Organov
2020-12-21 18:19:40 +03:00
committed by Junio C Hamano
parent 3b6c17b5c0
commit 3291eea310
3 changed files with 5 additions and 2 deletions

View File

@ -922,7 +922,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
return 0;
else if (opt->combine_merges)
return do_diff_combined(opt, commit);
else if (!opt->first_parent_only) {
else if (!opt->first_parent_merges) {
/* If we show multiple diffs, show the parent info */
log->parent = parents->item;
}
@ -941,7 +941,7 @@ static int log_tree_diff(struct rev_info *opt, struct commit *commit, struct log
/* Set up the log info for the next parent, if any.. */
parents = parents->next;
if (!parents || opt->first_parent_only)
if (!parents || opt->first_parent_merges)
break;
log->parent = parents->item;
opt->loginfo = log;