Fix repository URL handling in PublicGitRepository.php
This commit is contained in:
@@ -97,10 +97,14 @@ class PublicGitRepository extends Component
|
|||||||
if (
|
if (
|
||||||
(str($this->repository_url)->startsWith('https://') ||
|
(str($this->repository_url)->startsWith('https://') ||
|
||||||
str($this->repository_url)->startsWith('http://')) &&
|
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';
|
$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) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user