Fix repository URL handling in PublicGitRepository.php
This commit is contained in:
parent
a00b5aa136
commit
b16109ca56
1 changed files with 5 additions and 3 deletions
|
|
@ -89,9 +89,11 @@ public function load_any_git()
|
|||
public function load_branch()
|
||||
{
|
||||
try {
|
||||
$this->validate([
|
||||
'repository_url' => 'required|url'
|
||||
]);
|
||||
if (str($this->repository_url)->startsWith('git@')) {
|
||||
$github_instance = str($this->repository_url)->after('git@')->before(':');
|
||||
$repository = str($this->repository_url)->after(':')->before('.git');
|
||||
$this->repository_url = 'https://' . str($github_instance) . '/' . $repository;
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue