format-patch: add --interdiff option to embed diff in cover letter
[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
6void show_interdiff(struct rev_info *rev)
7{
8 struct diff_options opts;
9
10 memcpy(&opts, &rev->diffopt, sizeof(opts));
11 opts.output_format = DIFF_FORMAT_PATCH;
12 diff_setup_done(&opts);
13
14 diff_tree_oid(rev->idiff_oid1, rev->idiff_oid2, "", &opts);
15 diffcore_std(&opts);
16 diff_flush(&opts);
17}