1
0
Fork 0

Use refs API since it is more stable than the branches API with force-pushes, fixes #514

pull/528/head
Jordi Boggiano 2012-04-02 20:52:38 +02:00
parent 245a7ca845
commit 2844a5673d
1 changed files with 3 additions and 2 deletions

View File

@ -173,10 +173,11 @@ class GitHubDriver extends VcsDriver
return $this->gitDriver->getBranches();
}
if (null === $this->branches) {
$branchData = JsonFile::parseJson($this->getContents($this->getScheme() . '://api.github.com/repos/'.$this->owner.'/'.$this->repository.'/branches'));
$branchData = JsonFile::parseJson($this->getContents($this->getScheme() . '://api.github.com/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads'));
$this->branches = array();
foreach ($branchData as $branch) {
$this->branches[$branch['name']] = $branch['commit']['sha'];
$name = substr($branch['ref'], 11);
$this->branches[$name] = $branch['object']['sha'];
}
}