diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 3cd194df8..f01dafa32 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -153,8 +153,8 @@ class RepositoriesController < ApplicationController # 连接创建成功后的gitlab版本库 gitproject = GitlabProject.find_by_gitlab_project_id(temp[:gitprojectid]) @repository.login = user.login - @repository.url = gitproject.repository_url - @repository.root_url = gitproject.repository_url + @repository.url = gitproject.localfile_url + @repository.root_url = gitproject.localfile_url if request.post? && @repository.save redirect_to settings_project_path(@project, :tab => 'repositories') else diff --git a/app/helpers/gitlab_helper.rb b/app/helpers/gitlab_helper.rb index 679dcbdfc..a7a5b3cfc 100644 --- a/app/helpers/gitlab_helper.rb +++ b/app/helpers/gitlab_helper.rb @@ -82,7 +82,7 @@ module GitlabHelper # 新创建项目的web地址 web_url = temp['web_url'] web_url['http://localhost'] = REPO_IP_ADDRESS - # 新创建项目的本笃文件路径 + # 新创建项目的本地文件路径 localfile = temp['web_url'] localfile['http://localhost'] = ROOT_PATH @@ -124,6 +124,9 @@ module GitlabHelper # 新创建项目的web地址 web_url = temp['web_url'] web_url['http://localhost'] = REPO_IP_ADDRESS + # 新创建项目的本地文件路径 + localfile = temp['web_url'] + localfile['http://localhost'] = ROOT_PATH # 保存数据 gitproject = GitlabProject.new @@ -131,6 +134,7 @@ module GitlabHelper gitproject.gitlab_project_id = temp['id'] gitproject.repository_url = repository_url gitproject.web_url = web_url + gitproject.localfile_url = localfile gitproject.save tempResult[:result]= true tempResult[:gitprojectid]=gitproject.gitlab_project_id