allow not applying any patch

This commit is contained in:
Benjamin Dauvergne 2018-10-18 18:02:21 +02:00
parent 4d6c9c3f7f
commit 1c9a3ed29f
1 changed files with 4 additions and 1 deletions

View File

@ -161,8 +161,11 @@ def apply_attachments(repo, issue):
for i, attachment in enumerate(attachments):
print i, attachment.created_on, '%6d bytes' % attachment.filesize, attachment.filename
while True:
indexes = click.prompt('Which patch would you like to apply (id separated by spaces) ?', type=str)
indexes = click.prompt('Which patch would you like to apply (id separated by spaces) ?', type=str, default='')
try:
indexes = indexes.strip()
if not indexes:
break
indexes = map(int, indexes.split())
if not all(i < len(attachments) for i in indexes):
raise ValueError('invalid values', indexes)