fix: ensure newly created branches are available for switching (#511)

Fixed an issue where the "Change Branch" button didn't work when switching to a newly created remote branch after initially cloning the repository. Added `git fetch origin` to update branch references before switching.
This commit is contained in:
Dimitar Yanakiev
2025-02-28 20:38:38 +02:00
committed by GitHub
parent 1a5cf4c57a
commit e52903c649
3 changed files with 22 additions and 0 deletions

View File

@ -16,6 +16,7 @@ class UpdateBranch
public function update(Site $site, array $input): void
{
$site->branch = $input['branch'];
app(Git::class)->fetchOrigin($site);
app(Git::class)->checkout($site);
$site->save();
}