clean: report branch's deletion failure instead of stopping

This commit is contained in:
Benjamin Dauvergne 2021-11-25 11:39:28 +01:00
parent c58395944a
commit e32cda0fba
1 changed files with 6 additions and 2 deletions

View File

@ -642,8 +642,12 @@ def clean():
for _id, _subject in issues_to_delete:
ref = issues_to_branch[str(_id)]
click.echo('Deleting origin/%s... ' % ref, nl=False)
origin.push(refspec=':%s' % ref)
click.echo(click.style('Done.', fg='green'))
try:
origin.push(refspec=':%s' % ref)
except git.GitCommandError as e:
click.echo(click.style('Failed(%s).' % e, fg='red'))
else:
click.echo(click.style('Done.', fg='green'))
issues_to_branch = {}
for ref in repo.branches: