fix: if public repository does not have a main branch

This commit is contained in:
Andras Bacsai 2023-09-30 15:51:01 +02:00
parent 3d43f2127a
commit c618d912db

View File

@ -76,13 +76,14 @@ public function load_branch()
$this->get_branch();
$this->selected_branch = $this->git_branch;
} catch (\Throwable $e) {
return handleError($e, $this);
}
if (!$this->branch_found && $this->git_branch == 'main') {
try {
$this->git_branch = 'master';
$this->get_branch();
} catch (\Throwable $e) {
if (!$this->branch_found && $this->git_branch == 'main') {
try {
$this->git_branch = 'master';
$this->get_branch();
} catch (\Throwable $e) {
return handleError($e, $this);
}
} else {
return handleError($e, $this);
}
}