瀏覽代碼

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

Jordi Boggiano 11 年之前
父節點
當前提交
ab709107e5
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Composer/Repository/Vcs/HgBitbucketDriver.php

+ 2 - 2
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'];
         }