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:

committed by
Junio C Hamano

parent
cddd127b9a
commit
d8d33736b5
@ -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
|
||||
|
Reference in New Issue
Block a user