function GitBitbucketDriver::getRootIdentifier
@inheritDoc
Overrides VcsDriverInterface::getRootIdentifier
File
-
vendor/
composer/ composer/ src/ Composer/ Repository/ Vcs/ GitBitbucketDriver.php, line 476
Class
- GitBitbucketDriver
- @author Per Bernhardt <plb@webfactory.de>
Namespace
Composer\Repository\VcsCode
public function getRootIdentifier() : string {
if ($this->fallbackDriver) {
return $this->fallbackDriver
->getRootIdentifier();
}
if (null === $this->rootIdentifier) {
if (!$this->getRepoData()) {
if (!$this->fallbackDriver) {
throw new \LogicException('A fallback driver should be setup if getRepoData returns false');
}
return $this->fallbackDriver
->getRootIdentifier();
}
if ($this->vcsType !== 'git') {
throw new \RuntimeException($this->url . ' does not appear to be a git repository, use ' . $this->cloneHttpsUrl . ' but remember that Bitbucket no longer supports the mercurial repositories. ' . 'https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket');
}
$this->rootIdentifier = $this->repoData['mainbranch']['name'] ?? 'master';
}
return $this->rootIdentifier;
}