1
0
Fork 0

Fix detection of git bitbucket repos with incorrect URLs, fixes #2095

pull/2118/merge
Jordi Boggiano 2013-07-26 15:55:18 +02:00
parent 7252078508
commit ab709107e5
1 changed files with 2 additions and 2 deletions

View File

@ -46,8 +46,8 @@ class HgBitbucketDriver extends VcsDriver
if (null === $this->rootIdentifier) { if (null === $this->rootIdentifier) {
$resource = $this->getScheme() . '://bitbucket.org/api/1.0/repositories/'.$this->owner.'/'.$this->repository.'/tags'; $resource = $this->getScheme() . '://bitbucket.org/api/1.0/repositories/'.$this->owner.'/'.$this->repository.'/tags';
$repoData = JsonFile::parseJson($this->getContents($resource), $resource); $repoData = JsonFile::parseJson($this->getContents($resource), $resource);
if (array() === $repoData) { if (array() === $repoData || !isset($repoData['tip'])) {
throw new \RuntimeException('This does not appear to be a mercurial repository, use '.$this->url.'.git if this is a git bitbucket repository'); throw new \RuntimeException($this->url.' does not appear to be a mercurial repository, use '.$this->url.'.git if this is a git bitbucket repository');
} }
$this->rootIdentifier = $repoData['tip']['raw_node']; $this->rootIdentifier = $repoData['tip']['raw_node'];
} }