From ab709107e567c9ca88387cfc4273c0e863e15cef Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 26 Jul 2013 15:55:18 +0200 Subject: [PATCH] Fix detection of git bitbucket repos with incorrect URLs, fixes #2095 --- src/Composer/Repository/Vcs/HgBitbucketDriver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/Vcs/HgBitbucketDriver.php b/src/Composer/Repository/Vcs/HgBitbucketDriver.php index e9b7f1342..c7fe1ed55 100644 --- a/src/Composer/Repository/Vcs/HgBitbucketDriver.php +++ b/src/Composer/Repository/Vcs/HgBitbucketDriver.php @@ -46,8 +46,8 @@ class HgBitbucketDriver extends VcsDriver if (null === $this->rootIdentifier) { $resource = $this->getScheme() . '://bitbucket.org/api/1.0/repositories/'.$this->owner.'/'.$this->repository.'/tags'; $repoData = JsonFile::parseJson($this->getContents($resource), $resource); - if (array() === $repoData) { - throw new \RuntimeException('This does not appear to be a mercurial repository, use '.$this->url.'.git if this is a git bitbucket repository'); + if (array() === $repoData || !isset($repoData['tip'])) { + 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']; }