Merge pull request #22 from bwrsandman/patch-2

[IMP] runbot: support repo names with `.git` suffix when performing github API calls
This commit is contained in:
odony 2014-07-22 16:41:28 +02:00
commit 5509e7963b

View File

@ -208,7 +208,7 @@ class runbot_repo(osv.osv):
for repo in self.browse(cr, uid, ids, context=context):
if not repo.token:
raise Exception('Repository does not have a token to authenticate')
match_object = re.search('([^/]+)/([^/]+)/([^/]+)', repo.base)
match_object = re.search('([^/]+)/([^/]+)/([^/.]+(.git)?)', repo.base)
if match_object:
url = url.replace(':owner', match_object.group(2))
url = url.replace(':repo', match_object.group(3))