git-svn: support for git-svn propset
[gitweb.git] / t / t3203-branch-output.sh
index 97d10b1884d39cdef6efc9a0ce7384d7538ea366..ba4f98e800f262242ef7925f82dc8d13272fe3ca 100755 (executable)
@@ -37,6 +37,15 @@ test_expect_success 'git branch --list shows local branches' '
        test_cmp expect actual
 '
 
+cat >expect <<'EOF'
+  branch-one
+  branch-two
+EOF
+test_expect_success 'git branch --list pattern shows matching local branches' '
+       git branch --list branch* >actual &&
+       test_cmp expect actual
+'
+
 cat >expect <<'EOF'
   origin/HEAD -> origin/branch-one
   origin/branch-one
@@ -72,12 +81,26 @@ test_expect_success 'git branch -v shows branch summaries' '
 '
 
 cat >expect <<'EOF'
-* (no branch)
+two
+one
+EOF
+test_expect_success 'git branch --list -v pattern shows branch summaries' '
+       git branch --list -v branch* >tmp &&
+       awk "{print \$NF}" <tmp >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'git branch -v pattern does not show branch summaries' '
+       test_must_fail git branch -v branch*
+'
+
+test_expect_success 'git branch shows detached HEAD properly' '
+       cat >expect <<EOF &&
+* (detached from $(git rev-parse --short HEAD^0))
   branch-one
   branch-two
   master
 EOF
-test_expect_success 'git branch shows detached HEAD properly' '
        git checkout HEAD^0 &&
        git branch >actual &&
        test_i18ncmp expect actual