if (rev->idiff_oid1) {
fprintf_ln(rev->diffopt.file, "%s", rev->idiff_title);
- show_interdiff(rev, 0);
+ show_interdiff(rev->idiff_oid1, rev->idiff_oid2, 0,
+ &rev->diffopt);
}
if (rev->rdiff1) {
return data;
}
-void show_interdiff(struct rev_info *rev, int indent)
+void show_interdiff(const struct object_id *oid1, const struct object_id *oid2,
+ int indent, struct diff_options *diffopt)
{
struct diff_options opts;
struct strbuf prefix = STRBUF_INIT;
- memcpy(&opts, &rev->diffopt, sizeof(opts));
+ memcpy(&opts, diffopt, sizeof(opts));
opts.output_format = DIFF_FORMAT_PATCH;
opts.output_prefix = idiff_prefix_cb;
strbuf_addchars(&prefix, ' ', indent);
opts.output_prefix_data = &prefix;
diff_setup_done(&opts);
- diff_tree_oid(rev->idiff_oid1, rev->idiff_oid2, "", &opts);
+ diff_tree_oid(oid1, oid2, "", &opts);
diffcore_std(&opts);
diff_flush(&opts);
const struct diff_flags *flags,
int ita_invisible_in_index);
-void show_interdiff(struct rev_info *, int indent);
+/*
+ * Emit an interdiff of two object ID's to 'diff_options.file' optionally
+ * indented by 'indent' spaces.
+ */
+void show_interdiff(const struct object_id *, const struct object_id *,
+ int indent, struct diff_options *);
/*
* Fill the contents of the filespec "df", respecting any textconv defined by
next_commentary_block(opt, NULL);
fprintf_ln(opt->diffopt.file, "%s", opt->idiff_title);
- show_interdiff(opt, 2);
+ show_interdiff(opt->idiff_oid1, opt->idiff_oid2, 2,
+ &opt->diffopt);
memcpy(&diff_queued_diff, &dq, sizeof(diff_queued_diff));
}