summaryrefslogtreecommitdiff
path: root/xdiff-interface.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-04-12 17:15:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-11 03:47:31 (GMT)
commit5d93460024541909337d6b08a8bec10b71caaf73 (patch)
treea443204986e6f0febd3fbfbe2249131ddcdc00b9 /xdiff-interface.c
parent22233d43eb5479d1076e034eb5cdba973fa2b02a (diff)
downloadgit-5d93460024541909337d6b08a8bec10b71caaf73.zip
git-5d93460024541909337d6b08a8bec10b71caaf73.tar.gz
git-5d93460024541909337d6b08a8bec10b71caaf73.tar.bz2
xdiff-interface: replace discard_hunk_line() with a flag
Remove the dummy discard_hunk_line() function added in 3b40a090fd4 (diff: avoid generating unused hunk header lines, 2018-11-02) in favor of having a new XDL_EMIT_NO_HUNK_HDR flag, for use along with the two existing and similar XDL_EMIT_* flags. Unlike the recently amended xdiff_emit_line_fn interface which'll be called in a loop in xdl_emit_diff(), the hunk header is only emitted once. It makes more sense to pass this as a flag than provide a dummy callback because that function may be able to skip doing certain work if it knows the caller is doing nothing with the hunk header. It would be possible to do so in the case of -U0 now, but the benefit of doing so is so small that I haven't bothered. But this leaves the door open to that, and more importantly makes the API use more intuitive. The reason we're putting a flag in the gap between 1<<0 and 1<<2 is that the old 1<<1 flag was removed in 907681e940d (xdiff: drop XDL_EMIT_COMMON, 2016-02-23) without re-ordering the remaining flags. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff-interface.c')
-rw-r--r--xdiff-interface.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/xdiff-interface.c b/xdiff-interface.c
index 50c0ef7..95f13a9 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -126,12 +126,6 @@ int xdi_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t co
return xdl_diff(&a, &b, xpp, xecfg, xecb);
}
-void discard_hunk_line(void *priv,
- long ob, long on, long nb, long nn,
- const char *func, long funclen)
-{
-}
-
int xdi_diff_outf(mmfile_t *mf1, mmfile_t *mf2,
xdiff_emit_hunk_fn hunk_fn,
xdiff_emit_line_fn line_fn,