1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-06 05:16:15 +02:00

diff-merges: handle imply -p on -c/--cc logic for log.c

Move logic that handles implying -p on -c/--cc from
log_setup_revisions_tweak() to diff_merges_setup_revs(), where it
belongs.

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:41 +03:00 committed by Junio C Hamano
parent 3291eea310
commit 0c627f5d3c
2 changed files with 5 additions and 4 deletions

View File

@ -723,10 +723,6 @@ static void log_setup_revisions_tweak(struct rev_info *rev,
rev->prune_data.nr == 1)
rev->diffopt.flags.follow_renames = 1;
/* Turn --cc/-c into -p --cc/-c when -p was not given */
if (!rev->diffopt.output_format && rev->combine_merges)
rev->diffopt.output_format = DIFF_FORMAT_PATCH;
if (rev->first_parent_only)
diff_merges_default_to_first_parent(rev);
}

View File

@ -102,4 +102,9 @@ void diff_merges_setup_revs(struct rev_info *revs)
revs->ignore_merges = 1;
if (revs->combined_all_paths && !revs->combine_merges)
die("--combined-all-paths makes no sense without -c or --cc");
if (revs->combine_merges) {
/* Turn --cc/-c into -p --cc/-c when -p was not given */
if (!revs->diffopt.output_format)
revs->diffopt.output_format = DIFF_FORMAT_PATCH;
}
}