Add support for new GitHub API

main
Jordi Boggiano 12 years ago
parent a264219f07
commit 7a28a2d83a

@ -216,7 +216,13 @@ class GitHubDriver extends VcsDriver
}
try {
$repoData = JsonFile::parseJson($this->getContents($repoDataUrl));
$this->rootIdentifier = $repoData['master_branch'] ?: 'master';
if (isset($repoData['default_branch'])) {
$this->rootIdentifier = $repoData['default_branch'];
} elseif (isset($repoData['master_branch'])) {
$this->rootIdentifier = $repoData['master_branch'];
} else {
$this->rootIdentifier = 'master';
}
} catch (TransportException $e) {
switch($e->getCode()) {
case 401:

Loading…
Cancel
Save