From 76c0704bdf6ee8ac0be11830cb6ae8d08cc587a8 Mon Sep 17 00:00:00 2001 From: Lucas Seiki Oshiro Date: Thu, 4 Dec 2025 17:10:12 -0300 Subject: repo: add -z as an alias for --format=nul to git-repo-structure Other Git commands that have nul-terminated output, such as git-config, git-status, git-ls-files, and git-repo-info have a flag `-z` for using the null character as the record separator. Add the `-z` flag to git-repo-structure as an alias for `--format=nul`, making it consistent with the behavior of the other commands. Signed-off-by: Lucas Seiki Oshiro Signed-off-by: Junio C Hamano --- t/t1901-repo-structure.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't') diff --git a/t/t1901-repo-structure.sh b/t/t1901-repo-structure.sh index 36a71a144e..df7d4ea524 100755 --- a/t/t1901-repo-structure.sh +++ b/t/t1901-repo-structure.sh @@ -101,6 +101,13 @@ test_expect_success 'keyvalue and nul format' ' tr "\n=" "\0\n" expect_nul && git repo structure --format=nul >out 2>err && + test_cmp expect_nul out && + test_line_count = 0 err && + + # "-z", as a synonym to "--format=nul", participates in the + # usual "last one wins" rule. + git repo structure --format=table -z >out 2>err && + test_cmp expect_nul out && test_line_count = 0 err ) -- cgit v1.3-5-g9baa