From 7fffbfaea5231d5511288a142a3d0d74c3673b18 Mon Sep 17 00:00:00 2001 From: nwb Date: Thu, 24 Jul 2014 18:00:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=A1=B9=E7=9B=AE=E7=9A=84?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 4 ++-- app/helpers/gitlab_helper.rb | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) 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