fixed repo_git_submodule_url ssh url

This commit is contained in:
xxq250 2025-09-28 11:33:18 +08:00
parent 365345f15a
commit f545615567
1 changed files with 2 additions and 2 deletions

View File

@ -324,9 +324,9 @@ module RepositoriesHelper
def repo_git_submodule_url(owner, repo, path)
unless (path.starts_with?('http://') || path.starts_with?('https://'))
if path.starts_with?('git@code.gitlink.org.cn')
path = path.gsub("git@code.gitlink.org.cn","https://gitlink.org.cn").gsub(":","/")
path = path.gsub(":","/").gsub("git@code.gitlink.org.cn","https://gitlink.org.cn")
elsif path.starts_with?('git@code.gitlink.org.cn')
path = path.gsub("git@","https://").gsub(":","/")
path = path.gsub(":","/").gsub("git@","https://")
else
path = File.expand_path(path, "/#{owner&.login}/#{repo&.identifier}")
end