git/t/t4211
Michael Montalbo bacaa45296 diff: emit -L hunk headers via xdiff's formatter
Currently, diff's line-range filter implements its own method for
emitting diff hunk headers. This mostly matches what xdiff itself
outputs, but there is a discrepancy for postimage or preimage sides
with 0 line changes. For a side with no lines (count 0), the begin is
the line before the change. The header omits the line count of 1.

Rather than fix this case in the line-range implementation, expose the
function xdiff uses to emit its headers. Reusing it keeps the header
format consistent with and without -L.

Update test scenarios and fixtures to reflect the now consistent header
format.

Signed-off-by: Michael Montalbo <mmontalbo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-09-03 07:14:38 -07:00
..
sha1 diff: emit -L hunk headers via xdiff's formatter 2026-09-03 07:14:38 -07:00
sha256 diff: emit -L hunk headers via xdiff's formatter 2026-09-03 07:14:38 -07:00
history.export