Skip to content

Commit

Permalink
Fix new repo url normalization step
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 6, 2024
1 parent 9b50d56 commit 8499b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Entity/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public function setRepository(string $repoUrl): void
$repoUrl = Preg::replace('{^(https://github.com/.*?)\.git$}i', '$1', $repoUrl);
$repoUrl = Preg::replace('{^(https://github.com/.*?)/$}i', '$1', $repoUrl);
// support urls like https://github.com/foo/bar/tree/main/baz or other sub-URLs in a repo
$repoUrl = Preg::replace('{^(https://github.com/[^/]+/[^/]+).+$}i', '$1', $repoUrl);
$repoUrl = Preg::replace('{^(https://github.com/[^/]+/[^/]++).+$}i', '$1', $repoUrl);

$repoUrl = Preg::replace('{^git@gitlab.com:}i', 'https://gitlab.com/', $repoUrl);
$repoUrl = Preg::replace('{^https?://(?:www\.)?gitlab\.com/(.*?)\.git$}i', 'https://gitlab.com/$1', $repoUrl);
Expand Down

0 comments on commit 8499b5d

Please sign in to comment.