fix(git): keep IPv6 brackets in submodule web links (#39186)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Zhaoqi Xuandwxiaoguang authored and GitHub committed 2026-08-31 11:29:18 +00:00
1 parent 7c93ead628
commit 7c36ae7668
2 files changed
+15 -3

No files matched your search

+8
View File
@@ -264,4 +264,12 @@ func TestMakeRepositoryBaseLink(t *testing.T) {
u, err = ParseRepositoryURL(t.Context(), "git+ssh://other:123/owner/repo.git")
assert.NoError(t, err)
assert.Equal(t, "https://other/owner/repo", MakeRepositoryWebLink(u))
u, err = ParseRepositoryURL(t.Context(), "git+ssh://[::1]/owner/repo.git")
assert.NoError(t, err)
assert.Equal(t, "https://[::1]/owner/repo", MakeRepositoryWebLink(u))
u, err = ParseRepositoryURL(t.Context(), "git+ssh://[::1]:2222/owner/repo.git")
assert.NoError(t, err)
assert.Equal(t, "https://[::1]/owner/repo", MakeRepositoryWebLink(u))
}