Merge branch 'mh/notes-duplicate-entries'
[git/git.git] / interdiff.c
CommitLineData
126facf8
ES
1#include "cache.h"
2#include "commit.h"
3#include "revision.h"
4#include "interdiff.h"
5
3b026417
ES
6static struct strbuf *idiff_prefix_cb(struct diff_options *opt, void *data)
7{
8 return data;
9}
10
11void show_interdiff(struct rev_info *rev, int indent)
126facf8
ES
12{
13 struct diff_options opts;
3b026417 14 struct strbuf prefix = STRBUF_INIT;
126facf8
ES
15
16 memcpy(&opts, &rev->diffopt, sizeof(opts));
17 opts.output_format = DIFF_FORMAT_PATCH;
3b026417
ES
18 opts.output_prefix = idiff_prefix_cb;
19 strbuf_addchars(&prefix, ' ', indent);
20 opts.output_prefix_data = &prefix;
126facf8
ES
21 diff_setup_done(&opts);
22
23 diff_tree_oid(rev->idiff_oid1, rev->idiff_oid2, "", &opts);
24 diffcore_std(&opts);
25 diff_flush(&opts);
3b026417
ES
26
27 strbuf_release(&prefix);
126facf8 28}