public function get_remote_branches()
{
$branches = array();
$response = isset($this->response['branches']) ? $this->response['branches'] : false;
if ($this->exit_no_update($response, true)) {
return false;
}
if (!$response) {
$response = $this->api('/repos/:owner/:repo/branches');
if ($response) {
foreach ($response as $branch) {
$branches[$branch->name] = $this->construct_download_link(false, $branch->name);
}
$this->type->branches = $branches;
$this->set_transient('branches', $branches);
return true;
}
}
if ($this->validate_response($response)) {
return false;
}
$this->type->branches = $response;
return true;
}