summaryrefslogtreecommitdiff
path: root/t/t3203-branch-output.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t3203-branch-output.sh')
-rwxr-xr-xt/t3203-branch-output.sh51
1 files changed, 50 insertions, 1 deletions
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index b945faf470..f92fb3aab9 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -210,7 +210,7 @@ EOF
test_i18ncmp expect actual
'
-test_expect_success 'git branch `--sort` option' '
+test_expect_success 'git branch `--sort=[-]objectsize` option' '
cat >expect <<-\EOF &&
* (HEAD detached from fromtag)
branch-two
@@ -218,6 +218,55 @@ test_expect_success 'git branch `--sort` option' '
main
EOF
git branch --sort=objectsize >actual &&
+ test_i18ncmp expect actual &&
+
+ cat >expect <<-\EOF &&
+ branch-one
+ main
+ * (HEAD detached from fromtag)
+ branch-two
+ EOF
+ git branch --sort=-objectsize >actual &&
+ test_i18ncmp expect actual
+'
+
+test_expect_success 'git branch `--sort=[-]type` option' '
+ cat >expect <<-\EOF &&
+ * (HEAD detached from fromtag)
+ branch-one
+ branch-two
+ main
+ EOF
+ git branch --sort=type >actual &&
+ test_i18ncmp expect actual &&
+
+ cat >expect <<-\EOF &&
+ * (HEAD detached from fromtag)
+ branch-one
+ branch-two
+ main
+ EOF
+ git branch --sort=-type >actual &&
+ test_i18ncmp expect actual
+'
+
+test_expect_success 'git branch `--sort=[-]version:refname` option' '
+ cat >expect <<-\EOF &&
+ * (HEAD detached from fromtag)
+ branch-one
+ branch-two
+ main
+ EOF
+ git branch --sort=version:refname >actual &&
+ test_i18ncmp expect actual &&
+
+ cat >expect <<-\EOF &&
+ main
+ branch-two
+ branch-one
+ * (HEAD detached from fromtag)
+ EOF
+ git branch --sort=-version:refname >actual &&
test_i18ncmp expect actual
'