aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2016-08-05 18:00:28 -0400
committerJunio C Hamano <gitster@pobox.com>2016-08-05 15:46:42 -0700
commitc4f596b98ed305ceb594857fa34524fedc30a031 (patch)
tree9f341f925ee39be8d262794543c93769322167f6 /t
parentbe7e795efe35d3e50199af5452b218e5121b1713 (diff)
downloadgit-c4f596b98ed305ceb594857fa34524fedc30a031.tar.gz
git-c4f596b98ed305ceb594857fa34524fedc30a031.tar.xz
status: support --porcelain[=<version>]
Update --porcelain argument to take optional version parameter to allow multiple porcelain formats to be supported in the future. The token "v1" is the default value and indicates the traditional porcelain format. (The token "1" is an alias for that.) Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7060-wtstatus.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index 44bf1d84a..00e0cebff 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -228,4 +228,25 @@ test_expect_success 'status --branch with detached HEAD' '
test_i18ncmp expected actual
'
+## Duplicate the above test and verify --porcelain=v1 arg parsing.
+test_expect_success 'status --porcelain=v1 --branch with detached HEAD' '
+ git reset --hard &&
+ git checkout master^0 &&
+ git status --branch --porcelain=v1 >actual &&
+ cat >expected <<-EOF &&
+ ## HEAD (no branch)
+ ?? .gitconfig
+ ?? actual
+ ?? expect
+ ?? expected
+ ?? mdconflict/
+ EOF
+ test_i18ncmp expected actual
+'
+
+## Verify parser error on invalid --porcelain argument.
+test_expect_success 'status --porcelain=bogus' '
+ test_must_fail git status --porcelain=bogus
+'
+
test_done