from common.send_mail import prepare_mail
import gbp.rpm
+from gbp.git.repository import GitRepositoryError
WRONG_VERSION_MSG = '- The tag means you want to submit commit %s in %s branch'\
' to OBS, but this commit does NOT exist in %s branch. '\
branch = event['branch']
if event['branch'] == 'master':
branch = 'trunk'
- tag = mygit.describe(event['patchset_revision'], pattern='submit/%s/*'
- % branch, exact_match=True)
+ try:
+ tag = mygit.describe(event['patchset_revision'], pattern='submit/%s/*'
+ % branch, exact_match=True)
+ except GitRepositoryError, err:
+ # don'n find submit tag on this commit, return None
+ tag = None
return tag