From c618d912dbb1a0b92fe0dc398f92df9ca742d917 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 30 Sep 2023 15:51:01 +0200 Subject: [PATCH] fix: if public repository does not have a main branch --- .../Livewire/Project/New/PublicGitRepository.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php index 371a14f0b..4aee4c3bf 100644 --- a/app/Http/Livewire/Project/New/PublicGitRepository.php +++ b/app/Http/Livewire/Project/New/PublicGitRepository.php @@ -76,13 +76,14 @@ class PublicGitRepository extends Component $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); } }