1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 16:42:57 +00:00

Ignore headless mercurial branches in bitbucket API, fixes composer/packagist#778

This commit is contained in:
Jordi Boggiano 2017-04-14 00:08:27 +02:00
parent 8b0e615232
commit be38f7e65d

View file

@ -321,6 +321,11 @@ abstract class BitbucketDriver extends VcsDriver
); );
$hasNext = true; $hasNext = true;
while ($hasNext) { while ($hasNext) {
// skip headless branches which seem to be deleted branches that bitbucket nevertheless returns in the API
if ($this->vcsType === 'hg' && empty($data['heads'])) {
continue;
}
$branchData = JsonFile::parseJson($this->getContentsWithOAuthCredentials($resource), $resource); $branchData = JsonFile::parseJson($this->getContentsWithOAuthCredentials($resource), $resource);
foreach ($branchData['values'] as $data) { foreach ($branchData['values'] as $data) {
$this->branches[$data['name']] = $data['target']['hash']; $this->branches[$data['name']] = $data['target']['hash'];