]> Kevux Git Server - rit/commit
t4052: test for diffstat width when prefix contains ANSI escape codes
authorLorenzoPegorari <lorenzo.pegorari2002@gmail.com>
Fri, 27 Feb 2026 21:48:35 +0000 (22:48 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Feb 2026 21:59:22 +0000 (13:59 -0800)
commit064b869efc50be2557015665bc3dc8ac9008a6e4
treea0233c7d0098a88513f6a4d354d30076ec52ab93
parent1a9df8de368cbebd881336f64e424422f3dbb993
t4052: test for diffstat width when prefix contains ANSI escape codes

Add test checking the calculation of the diffstat display width when the
`line_prefix`, which is text that goes before the diffstat, contains
ANSI escape codes.

This situation happens, for example, when `git log --stat --graph` is
executed:
* `--stat` will create a diffstat for each commit
* `--graph` will stuff `line_prefix` with the graph portion of the log,
  which contains ANSI escape codes to color the text

Signed-off-by: LorenzoPegorari <lorenzo.pegorari2002@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4052-stat-output.sh