branch: allow pattern arguments

Allow pattern arguments for the list mode just like for git tag -l.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael J Gruber
2011-08-28 16:54:32 +02:00
committed by Junio C Hamano
parent cddd127b9a
commit d8d33736b5
3 changed files with 46 additions and 5 deletions

View File

@ -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
@ -71,6 +80,16 @@ test_expect_success 'git branch -v shows branch summaries' '
test_cmp expect actual
'
cat >expect <<'EOF'
two
one
EOF
test_expect_success 'git branch -v pattern shows branch summaries' '
git branch -v branch* >tmp &&
awk "{print \$NF}" <tmp >actual &&
test_cmp expect actual
'
cat >expect <<'EOF'
* (no branch)
branch-one