summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-05-10 10:49:46 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-05-10 10:49:46 -0700
commitf7858ad1e1686ff65cc77989c49f13352934adbc (patch)
treedcfff9ae3f2959898333a6d3bf4165cf7c11092f /t
parentMerge branch 'fa/maint-config-doc' (diff)
parentstatus: refactor colopts handling (diff)
downloadtgif-f7858ad1e1686ff65cc77989c49f13352934adbc.tar.xz
Merge branch 'jk/status-porcelain-z-b'
"git status --porcelain" ignored "--branch" option by mistake. The output for "git status --branch -z" was also incorrect and did not terminate the record for the current branch name with NUL as asked. By Jeff King via Jeff King * jk/status-porcelain-z-b: status: refactor colopts handling status: respect "-b" for porcelain format status: fix null termination with "-b" status: refactor null_termination option commit: refactor option parsing
Diffstat (limited to 't')
-rwxr-xr-xt/t7508-status.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 8f5cfac331..28e184829c 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -295,6 +295,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 &&
@@ -671,9 +680,14 @@ test_expect_success 'status --porcelain ignores color.status' '
git config --unset color.status
git config --unset color.ui
-test_expect_success 'status --porcelain ignores -b' '
+test_expect_success 'status --porcelain respects -b' '
git status --porcelain -b >output &&
+ {
+ echo "## master" &&
+ cat expect
+ } >tmp &&
+ mv tmp expect &&
test_cmp expect output
'