No gitolite in project any more
This commit is contained in:
parent
8e0b58d7e7
commit
d64090b8a9
27 changed files with 117 additions and 159 deletions
|
@ -31,8 +31,6 @@ class Namespace < ActiveRecord::Base
|
|||
|
||||
scope :root, where('type IS NULL')
|
||||
|
||||
attr_accessor :require_update_gitolite
|
||||
|
||||
def self.search query
|
||||
where("name LIKE :query OR path LIKE :query", query: "%#{query}%")
|
||||
end
|
||||
|
@ -60,13 +58,13 @@ class Namespace < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def namespace_full_path
|
||||
@namespace_full_path ||= File.join(Gitlab.config.gitolite.repos_path, path)
|
||||
@namespace_full_path ||= File.join(Gitlab.config.gitlab_shell.repos_path, path)
|
||||
end
|
||||
|
||||
def move_dir
|
||||
if path_changed?
|
||||
old_path = File.join(Gitlab.config.gitolite.repos_path, path_was)
|
||||
new_path = File.join(Gitlab.config.gitolite.repos_path, path)
|
||||
old_path = File.join(Gitlab.config.gitlab_shell.repos_path, path_was)
|
||||
new_path = File.join(Gitlab.config.gitlab_shell.repos_path, path)
|
||||
if File.exists?(new_path)
|
||||
raise "Already exists"
|
||||
end
|
||||
|
@ -81,7 +79,6 @@ class Namespace < ActiveRecord::Base
|
|||
|
||||
FileUtils.mv( old_path, new_path )
|
||||
send_update_instructions
|
||||
@require_update_gitolite = true
|
||||
rescue Exception => e
|
||||
raise "Namespace move error #{old_path} #{new_path}"
|
||||
end
|
||||
|
@ -89,7 +86,7 @@ class Namespace < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def rm_dir
|
||||
dir_path = File.join(Gitlab.config.gitolite.repos_path, path)
|
||||
dir_path = File.join(Gitlab.config.gitlab_shell.repos_path, path)
|
||||
FileUtils.rm_r( dir_path, force: true )
|
||||
end
|
||||
|
||||
|
|
|
@ -140,10 +140,6 @@ class Project < ActiveRecord::Base
|
|||
nil
|
||||
end
|
||||
|
||||
def git_error?
|
||||
error_code == :gitolite
|
||||
end
|
||||
|
||||
def saved?
|
||||
id && valid?
|
||||
end
|
||||
|
@ -157,7 +153,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def repo_name
|
||||
denied_paths = %w(gitolite-admin admin dashboard groups help profile projects search)
|
||||
denied_paths = %w(admin dashboard groups help profile projects search)
|
||||
|
||||
if denied_paths.include?(path)
|
||||
errors.add(:path, "like #{path} is not allowed")
|
||||
|
@ -450,7 +446,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def url_to_repo
|
||||
gitolite.url_to_repo(path_with_namespace)
|
||||
gitlab_shell.url_to_repo(path_with_namespace)
|
||||
end
|
||||
|
||||
def namespace_dir
|
||||
|
|
|
@ -25,7 +25,7 @@ class Repository
|
|||
end
|
||||
|
||||
def path_to_repo
|
||||
@path_to_repo ||= File.join(Gitlab.config.gitolite.repos_path, "#{path_with_namespace}.git")
|
||||
@path_to_repo ||= File.join(Gitlab.config.gitlab_shell.repos_path, "#{path_with_namespace}.git")
|
||||
end
|
||||
|
||||
def repo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue