def new_branch():
"""
Creating new branch
"""
branch_type = slugify((prompt('Branch type:', default='feature')))
issue_id = prompt("Issue ID:")
short_description = slugify(prompt('Short description:'))
if not branch_type or not short_description:
raise ValueError('[Branch type] and [Short description] are'
'mandatory.')
if issue_id:
issue_id = '-#{0}'.format(issue_id)
branch_name = "{0}{1}-{2}".format(branch_type, issue_id, short_description)
ru_sure = prompt(
text='Branch name will be "{0}", Are sure? (y/n)'.format(branch_name),
default='y'
)
if ru_sure != 'y':
return
_git('checkout -b "{0}"'.format(branch_name))
评论列表
文章目录