From b7402c3b2dc3292168726509b8886292495f06f7 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 28 Jun 2014 20:23:22 +0200 Subject: [PATCH] Ignore gh-pages branches, fixes #3073 --- src/Composer/Repository/Vcs/GitHubDriver.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Repository/Vcs/GitHubDriver.php b/src/Composer/Repository/Vcs/GitHubDriver.php index bb9e34fc7..5ab590aea 100644 --- a/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/src/Composer/Repository/Vcs/GitHubDriver.php @@ -227,11 +227,15 @@ class GitHubDriver extends VcsDriver $this->branches = array(); $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_page=100'; + $branchBlacklist = array('gh-pages'); + do { $branchData = JsonFile::parseJson($this->getContents($resource), $resource); foreach ($branchData as $branch) { $name = substr($branch['ref'], 11); - $this->branches[$name] = $branch['object']['sha']; + if (!in_array($name, $branchBlacklist)) { + $this->branches[$name] = $branch['object']['sha']; + } } $resource = $this->getNextPage();