diff options
Diffstat (limited to 'log-tree.c')
-rw-r--r-- | log-tree.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/log-tree.c b/log-tree.c index 7a5828ce63..ba5632805e 100644 --- a/log-tree.c +++ b/log-tree.c @@ -146,7 +146,7 @@ static int ref_filter_match(const char *refname, return 1; } -static int add_ref_decoration(const char *refname, const struct object_id *oid, +static int add_ref_decoration(const char *refname, const char *referent UNUSED, const struct object_id *oid, int flags UNUSED, void *cb_data) { @@ -675,7 +675,7 @@ static void show_diff_of_diff(struct rev_info *opt) struct diff_queue_struct dq; memcpy(&dq, &diff_queued_diff, sizeof(diff_queued_diff)); - DIFF_QUEUE_CLEAR(&diff_queued_diff); + diff_queue_init(&diff_queued_diff); fprintf_ln(opt->diffopt.file, "\n%s", opt->idiff_title); show_interdiff(opt->idiff_oid1, opt->idiff_oid2, 2, @@ -694,7 +694,7 @@ static void show_diff_of_diff(struct rev_info *opt) }; memcpy(&dq, &diff_queued_diff, sizeof(diff_queued_diff)); - DIFF_QUEUE_CLEAR(&diff_queued_diff); + diff_queue_init(&diff_queued_diff); fprintf_ln(opt->diffopt.file, "\n%s", opt->rdiff_title); /* @@ -1010,8 +1010,19 @@ static int do_remerge_diff(struct rev_info *opt, struct strbuf parent1_desc = STRBUF_INIT; struct strbuf parent2_desc = STRBUF_INIT; + /* + * Lazily prepare a temporary object directory and rotate it + * into the alternative object store list as the primary. + */ + if (opt->remerge_diff && !opt->remerge_objdir) { + opt->remerge_objdir = tmp_objdir_create("remerge-diff"); + if (!opt->remerge_objdir) + return error(_("unable to create temporary object directory")); + tmp_objdir_replace_primary_odb(opt->remerge_objdir, 1); + } + /* Setup merge options */ - init_merge_options(&o, the_repository); + init_ui_merge_options(&o, the_repository); o.show_rename_progress = 0; o.record_conflict_msgs_as_headers = 1; o.msg_header_prefix = "remerge"; @@ -1046,10 +1057,7 @@ static int do_remerge_diff(struct rev_info *opt, merge_finalize(&o, &res); /* Clean up the contents of the temporary object directory */ - if (opt->remerge_objdir) - tmp_objdir_discard_objects(opt->remerge_objdir); - else - BUG("did a remerge diff without remerge_objdir?!?"); + tmp_objdir_discard_objects(opt->remerge_objdir); return !opt->loginfo; } |