版本库显示问题
This commit is contained in:
parent
6193dc8f0a
commit
1a549eda46
|
@ -107,7 +107,7 @@ class Repository < ActiveRecord::Base
|
|||
def scm
|
||||
unless @scm
|
||||
@scm = self.scm_adapter.new(url, root_url,
|
||||
login, password, path_encoding)
|
||||
login, password, path_encoding, project_id)
|
||||
if root_url.blank? && @scm.root_url.present?
|
||||
update_attribute(:root_url, @scm.root_url)
|
||||
end
|
||||
|
|
|
@ -80,7 +80,7 @@ module Redmine
|
|||
end
|
||||
|
||||
def initialize(url, root_url=nil, login=nil, password=nil,
|
||||
path_encoding=nil)
|
||||
path_encoding=nil, project_id)
|
||||
@url = url
|
||||
@login = login if login && !login.empty?
|
||||
@password = (password || "") if @login
|
||||
|
|
|
@ -13,10 +13,12 @@ module Redmine
|
|||
attr_accessor :is_default
|
||||
end
|
||||
|
||||
def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil)
|
||||
def initialize(url, root_url=nil, login=nil, password=nil, path_encoding=nil, project_id)
|
||||
super
|
||||
@g = Gitlab.client
|
||||
@project = Repository.find_by_url(url).project.gpid
|
||||
r = Repository.where("url =? and project_id =?", url, project_id).first
|
||||
@project = r.project.gpid
|
||||
# @project = Repository.find_by_url(url).project.gpid
|
||||
@path_encoding = path_encoding.blank? ? 'UTF-8' : path_encoding
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue