Skip to content

Commit 7ea580e

Browse files
committed
Protect multiple branches
1 parent d696f89 commit 7ea580e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

branchmgr/main.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async def protection(organisation, repo, branch):
123123
@cli.command()
124124
@click.argument('organisation')
125125
@click.argument('repo')
126-
@click.argument('branch')
126+
@click.argument('branch', nargs=-1)
127127
@synchronize
128128
async def protect(organisation, repo, branch):
129129
"""
@@ -133,4 +133,9 @@ async def protect(organisation, repo, branch):
133133
branchmgr provides.
134134
"""
135135
client = APIClient()
136-
await client.protect_branch(organisation, repo, branch)
136+
results = []
137+
for b in branch:
138+
d = defer.ensureDeferred(client.protect_branch(organisation, repo, b))
139+
results.append(d)
140+
141+
await defer.gatherResults(results, consumeErrors=True)

0 commit comments

Comments
 (0)