Fix repository URL handling in PublicGitRepository.php
This commit is contained in:
parent
57d67bc4a8
commit
4af766162e
@ -97,10 +97,14 @@ public function load_branch()
|
||||
if (
|
||||
(str($this->repository_url)->startsWith('https://') ||
|
||||
str($this->repository_url)->startsWith('http://')) &&
|
||||
!str($this->repository_url)->endsWith('.git')
|
||||
!str($this->repository_url)->endsWith('.git') &&
|
||||
!str($this->repository_url)->contains('github.com')
|
||||
) {
|
||||
$this->repository_url = $this->repository_url . '.git';
|
||||
}
|
||||
if (str($this->repository_url)->contains('github.com')) {
|
||||
$this->repository_url = str($this->repository_url)->before('.git')->value();
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user