fix(git): exclude SSH ports from provider URLs (#12537)
This commit is contained in:
1 parent
dd8332da57
commit
29a32660d3
2 files changed
+23
-1
No files matched your search
@@ -110,6 +110,23 @@ describe("detectSourceControlProviderFromRemoteUrl", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("does not reuse SSH ports for HTTPS provider URLs", () => {
|
||||
expect(
|
||||
detectSourceControlProviderFromRemoteUrl("ssh://[email protected]:24/group/repo.git"),
|
||||
).toEqual({
|
||||
kind: "gitlab",
|
||||
name: "GitLab Self-Hosted",
|
||||
baseUrl: "https://gitlab.example.test",
|
||||
});
|
||||
expect(
|
||||
detectSourceControlProviderFromRemoteUrl("ssh://[email protected]:24/team/project.git"),
|
||||
).toEqual({
|
||||
kind: "unknown",
|
||||
name: "code.example.test",
|
||||
baseUrl: "https://code.example.test",
|
||||
});
|
||||
});
|
||||
|
||||
it("matches self-hosted providers by complete DNS labels", () => {
|
||||
expect(
|
||||
detectSourceControlProviderFromRemoteUrl("https://github.example.com/owner/repo.git")?.kind,
|
||||
|
||||
Reference in new issue
Block a user