diff-lib: tighten show_interdiff()'s interface

To compute and show an interdiff, show_interdiff() needs only the two
OID's to compare and a diffopts, yet it expects callers to supply an
entire rev_info. The demand for rev_info is not only overkill, but also
places unnecessary burden on potential future callers which might not
otherwise have a rev_info at hand. Address this by tightening its
signature to require only the items it needs instead of a full rev_info.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Eric Sunshine
2020-09-08 03:16:09 -04:00
committed by Junio C Hamano
parent cdffbdc217
commit 72a7239016
4 changed files with 14 additions and 6 deletions

View File

@ -1206,7 +1206,8 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
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) {