1
0
Fork 0

Ignore gh-pages branches, fixes #3073

pull/2415/merge
Jordi Boggiano 2014-06-28 20:23:22 +02:00
parent 28c65b5425
commit b7402c3b2d
1 changed files with 5 additions and 1 deletions

View File

@ -227,12 +227,16 @@ class GitHubDriver extends VcsDriver
$this->branches = array(); $this->branches = array();
$resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_page=100'; $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_page=100';
$branchBlacklist = array('gh-pages');
do { do {
$branchData = JsonFile::parseJson($this->getContents($resource), $resource); $branchData = JsonFile::parseJson($this->getContents($resource), $resource);
foreach ($branchData as $branch) { foreach ($branchData as $branch) {
$name = substr($branch['ref'], 11); $name = substr($branch['ref'], 11);
if (!in_array($name, $branchBlacklist)) {
$this->branches[$name] = $branch['object']['sha']; $this->branches[$name] = $branch['object']['sha'];
} }
}
$resource = $this->getNextPage(); $resource = $this->getNextPage();
} while ($resource); } while ($resource);