fix(git): exclude SSH ports from provider URLs (#12537)

This commit is contained in:
Anton Bezdenezhnykh authored and GitHub committed 2026-09-25 23:14:20 -05:00
1 parent dd8332da57
commit 29a32660d3
2 files changed
+23 -1

No files matched your search

+17
View File
@@ -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,