Add support for new GitHub API
parent
a264219f07
commit
7a28a2d83a
|
@ -216,7 +216,13 @@ class GitHubDriver extends VcsDriver
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$repoData = JsonFile::parseJson($this->getContents($repoDataUrl));
|
$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) {
|
} catch (TransportException $e) {
|
||||||
switch($e->getCode()) {
|
switch($e->getCode()) {
|
||||||
case 401:
|
case 401:
|
||||||
|
|
Loading…
Reference in New Issue