Merge pull request #1767 from coreos-inc/bitbucket-lookup
Fix manual run under bitbucket repos with many tags/branches
This commit is contained in:
commit
715cfd8313
1 changed files with 6 additions and 6 deletions
|
@ -513,19 +513,19 @@ class BitbucketBuildTrigger(BuildTriggerHandler):
|
|||
|
||||
def get_branch_sha(branch_name):
|
||||
# Lookup the commit SHA for the branch.
|
||||
(result, data, _) = repository.get_branches()
|
||||
if not result or not branch_name in data:
|
||||
(result, data, _) = repository.get_branch(branch_name)
|
||||
if not result:
|
||||
raise TriggerStartException('Could not find branch commit SHA')
|
||||
|
||||
return data[branch_name]['node']
|
||||
return data['target']['hash']
|
||||
|
||||
def get_tag_sha(tag_name):
|
||||
# Lookup the commit SHA for the tag.
|
||||
(result, data, _) = repository.get_tags()
|
||||
if not result or not tag_name in data:
|
||||
(result, data, _) = repository.get_tag(tag_name)
|
||||
if not result:
|
||||
raise TriggerStartException('Could not find tag commit SHA')
|
||||
|
||||
return data[tag_name]['node']
|
||||
return data['target']['hash']
|
||||
|
||||
def lookup_author(email_address):
|
||||
(result, data, _) = bitbucket_client.accounts().get_profile(email_address)
|
||||
|
|
Reference in a new issue