summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJiang Xin <worldhello.net@gmail.com>2025-11-15 08:36:11 -0500
committerJunio C Hamano <gitster@pobox.com>2025-11-16 16:04:24 -0800
commit7a03a10a3a746dd8565a3a0e6126f60523b41738 (patch)
treeb1330f181a430a74e799b08dfc2f2a808ace19e1 /diff.c
parent878fef8ebf6cf513842de14284ee58f4d92fcef3 (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 'diff.c')
0 files changed, 0 insertions, 0 deletions