aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-10-24 13:48:04 -0700
committerJunio C Hamano <gitster@pobox.com>2025-10-24 13:48:04 -0700
commite7909b3a90ea75b2fffb89eba399c90c8669cc23 (patch)
tree19a38a36f03930bab84cebaf2a07b338ffac92fa /t
parentMerge branch 'js/t7500-pwd-windows-fix' (diff)
parentstatus: make coloring of "-z --short" consistent (diff)
downloadgit-e7909b3a90ea75b2fffb89eba399c90c8669cc23.tar.gz
git-e7909b3a90ea75b2fffb89eba399c90c8669cc23.zip
Merge branch 'jk/status-z-short-fix'
The "--short" option of "git status" that meant output for humans and "-z" option to show NUL delimited output format did not mix well, and colored some but not all things. The command has been updated to color all elements consistently in such a case. * jk/status-z-short-fix: status: make coloring of "-z --short" consistent
Diffstat (limited to 't')
-rwxr-xr-xt/t7508-status.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index cdc1d6fcc7..abad229e9d 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -717,6 +717,17 @@ test_expect_success TTY 'status -s with color.status' '
'
+test_expect_success TTY 'status -s keeps colors with -z' '
+ test_when_finished "rm -f output.*" &&
+ test_terminal git status -s -z >output.raw &&
+ # convert back to newlines to avoid portability issues with
+ # test_decode_color and test_cmp, and to let us use the same expected
+ # output as earlier tests
+ tr "\0" "\n" <output.raw >output.nl &&
+ test_decode_color <output.nl >output &&
+ test_cmp expect output
+'
+
cat >expect <<\EOF
## <YELLOW>main<RESET>...<CYAN>upstream<RESET> [ahead <YELLOW>1<RESET>, behind <CYAN>2<RESET>]
<RED>M<RESET> dir1/modified