/**
  * {@inheritDoc}
  */
 public function getRootIdentifier()
 {
     if ($this->gitDriver) {
         return $this->gitDriver->getRootIdentifier();
     }
     return $this->rootIdentifier;
 }
Beispiel #2
0
 /**
  * {@inheritDoc}
  */
 public function getRootIdentifier()
 {
     if ($this->gitDriver) {
         return $this->gitDriver->getRootIdentifier();
     }
     if (null === $this->rootIdentifier) {
         $resource = $this->getScheme() . '://api.bitbucket.org/1.0/repositories/' . $this->owner . '/' . $this->repository;
         $repoData = JsonFile::parseJson($this->getContentsWithOAuthCredentials($resource, true), $resource);
         $this->hasIssues = !empty($repoData['has_issues']);
         $this->rootIdentifier = !empty($repoData['main_branch']) ? $repoData['main_branch'] : 'master';
     }
     return $this->rootIdentifier;
 }