|
|
|
@ -143,13 +143,11 @@ class Repository < ActiveRecord::Base
|
|
|
|
|
# 兼容老git模式
|
|
|
|
|
ip = RepositoriesHelper::REPO_IP_ADDRESS
|
|
|
|
|
if ip.nil?
|
|
|
|
|
ip = Setting.repository_domain
|
|
|
|
|
self.url
|
|
|
|
|
else
|
|
|
|
|
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
|
|
|
|
"http://" + self.login.to_s + self.identifier.to_s + ip + self.url.slice(project_path_cut, self.url.length)
|
|
|
|
|
end
|
|
|
|
|
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
|
|
|
|
if project_path_cut.nil?
|
|
|
|
|
project_path_cut = 40
|
|
|
|
|
end
|
|
|
|
|
"http://" + self.login.to_s + self.identifier.to_s + ip + self.url.slice(project_path_cut, self.url.length)
|
|
|
|
|
else
|
|
|
|
|
self.url
|
|
|
|
|
end
|
|
|
|
|