summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-02-17 17:21:41 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-02-17 17:21:41 -0800
commitdadc91ff0c15b655070ad334a27a734e91635bd5 (patch)
treec53f828a0941fae682ee087bd21e935de607e2e5 /log-tree.c
parentMerge branch 'js/range-diff-wo-dotdot' (diff)
parentrange-diff: offer --left-only/--right-only options (diff)
downloadtgif-dadc91ff0c15b655070ad334a27a734e91635bd5.tar.xz
Merge branch 'js/range-diff-one-side-only'
The "git range-diff" command learned "--(left|right)-only" option to show only one side of the compared range. * js/range-diff-one-side-only: range-diff: offer --left-only/--right-only options range-diff: move the diffopt initialization down one layer range-diff: combine all options in a single data structure range-diff: simplify code spawning `git log` range-diff: libify the read_patches() function again range-diff: avoid leaking memory in two error code paths
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/log-tree.c b/log-tree.c
index e048467650..e7dab99950 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -808,6 +808,11 @@ void show_log(struct rev_info *opt)
if (cmit_fmt_is_mail(ctx.fmt) && opt->rdiff1) {
struct diff_queue_struct dq;
struct diff_options opts;
+ struct range_diff_options range_diff_opts = {
+ .creation_factor = opt->creation_factor,
+ .dual_color = 1,
+ .diffopt = &opts
+ };
memcpy(&dq, &diff_queued_diff, sizeof(diff_queued_diff));
DIFF_QUEUE_CLEAR(&diff_queued_diff);
@@ -822,8 +827,7 @@ void show_log(struct rev_info *opt)
opts.file = opt->diffopt.file;
opts.use_color = opt->diffopt.use_color;
diff_setup_done(&opts);
- show_range_diff(opt->rdiff1, opt->rdiff2,
- opt->creation_factor, 1, &opts, NULL);
+ show_range_diff(opt->rdiff1, opt->rdiff2, &range_diff_opts);
memcpy(&diff_queued_diff, &dq, sizeof(diff_queued_diff));
}