diff options
| author | Jiang Xin <worldhello.net@gmail.com> | 2025-11-15 08:36:11 -0500 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-11-16 16:04:24 -0800 |
| commit | 7a03a10a3a746dd8565a3a0e6126f60523b41738 (patch) | |
| tree | b1330f181a430a74e799b08dfc2f2a808ace19e1 /t/unit-tests/clar/example/example.c | |
| parent | 878fef8ebf6cf513842de14284ee58f4d92fcef3 (diff) | |
builtin/repo: fix table alignment for UTF-8 characters
The output table from "git repo structure" is misaligned when displaying
UTF-8 characters (e.g., non-ASCII glyphs). E.g.:
| 仓库结构 | 值 |
| -------------- | ---- |
| * 引用 | |
| * 计数 | 67 |
The previous implementation used simple width formatting with printf()
which didn't properly handle multi-byte UTF-8 characters, causing
misaligned table columns when displaying repository structure
information.
This change modifies the stats_table_print_structure function to use
strbuf_utf8_align() instead of basic printf width specifiers. This
ensures proper column alignment regardless of the character encoding of
the content being displayed.
Also add test cases for strbuf_utf8_align(), a function newly introduced
in "builtin/repo.c".
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/clar/example/example.c')
0 files changed, 0 insertions, 0 deletions
