summaryrefslogtreecommitdiffstats
path: root/log-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/log-tree.c b/log-tree.c
index 13524bc888..33eb96b50c 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)
{
@@ -922,12 +922,7 @@ int log_tree_diff_flush(struct rev_info *opt)
* diff/diffstat output for readability.
*/
int pch = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
- if (opt->diffopt.output_prefix) {
- struct strbuf *msg = NULL;
- msg = opt->diffopt.output_prefix(&opt->diffopt,
- opt->diffopt.output_prefix_data);
- fwrite(msg->buf, msg->len, 1, opt->diffopt.file);
- }
+ fputs(diff_line_prefix(&opt->diffopt), opt->diffopt.file);
/*
* We may have shown three-dashes line early
@@ -1015,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";
@@ -1051,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;
}