summaryrefslogtreecommitdiff
path: root/t/t7508-status.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-05-07 21:02:18 (GMT)
committerJeff King <peff@peff.net>2012-05-08 08:51:08 (GMT)
commita5985237878481af5fbca349d0d1ad7d6b2d2bcb (patch)
tree229ed5444925bc654ddbe1161d97f4af9f83b419 /t/t7508-status.sh
parent3207a3a29179c247d1ee9552511123e426845acb (diff)
downloadgit-a5985237878481af5fbca349d0d1ad7d6b2d2bcb.zip
git-a5985237878481af5fbca349d0d1ad7d6b2d2bcb.tar.gz
git-a5985237878481af5fbca349d0d1ad7d6b2d2bcb.tar.bz2
status: fix null termination with "-b"
When the "-z" option is given to status, we are supposed to NUL-terminate each record. However, the "-b" code to show the tracking branch did not respect this, and always ended with a newline. Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 't/t7508-status.sh')
-rwxr-xr-xt/t7508-status.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index fc57b13..24728fa 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -271,6 +271,15 @@ test_expect_success 'status -s -b' '
'
+test_expect_success 'status -s -z -b' '
+ tr "\\n" Q <expect >expect.q &&
+ mv expect.q expect &&
+ git status -s -z -b >output &&
+ nul_to_q <output >output.q &&
+ mv output.q output &&
+ test_cmp expect output
+'
+
test_expect_success 'setup dir3' '
mkdir dir3 &&
: >dir3/untracked1 &&