diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-11 19:16:59 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-11 19:16:59 +0200 |
commit | d64090b8a9065746c6d532057228c079a1d57013 (patch) | |
tree | a97504c15dedfd470d9ffc11c51bd15a6718e8cb /app | |
parent | 8e0b58d7e7cde0d9afb93f267197f62b9b649cd3 (diff) | |
download | gitlab-ce-d64090b8a9065746c6d532057228c079a1d57013.tar.gz |
No gitolite in project any more
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/projects_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/errors_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 2 | ||||
-rw-r--r-- | app/models/namespace.rb | 11 | ||||
-rw-r--r-- | app/models/project.rb | 8 | ||||
-rw-r--r-- | app/models/repository.rb | 2 | ||||
-rw-r--r-- | app/views/admin/groups/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/errors/gitolite.html.haml | 25 | ||||
-rw-r--r-- | app/workers/gitlab_shell_worker.rb (renamed from app/workers/gitolite_worker.rb) | 4 | ||||
-rw-r--r-- | app/workers/post_receive.rb | 9 |
10 files changed, 15 insertions, 53 deletions
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 711817395f1..8ae0bba9a2d 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -41,9 +41,7 @@ class Admin::ProjectsController < Admin::ApplicationController end def destroy - # Delete team first in order to prevent multiple gitolite calls @project.team.truncate - @project.destroy redirect_to admin_projects_path, notice: 'Project was successfully deleted.' diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index e998d72365c..a0c8a000fc7 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -1,5 +1,2 @@ class ErrorsController < ApplicationController - def githost - render "errors/gitolite" - end end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 7978ea6222c..5da3fbf591c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -93,9 +93,7 @@ class ProjectsController < ProjectResourceController def destroy return access_denied! unless can?(current_user, :remove_project, project) - # Delete team first in order to prevent multiple gitolite calls project.team.truncate - project.destroy respond_to do |format| diff --git a/app/models/namespace.rb b/app/models/namespace.rb index f17d8f65183..547d383d911 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -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 diff --git a/app/models/project.rb b/app/models/project.rb index e6be2d2ce84..fee45f57735 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 diff --git a/app/models/repository.rb b/app/models/repository.rb index 6d490980764..37431fe3b0e 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -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 diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index 6ae8a75d696..90f8fc0f814 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -22,7 +22,7 @@ %b Path: %td - %span.monospace= File.join(Gitlab.config.gitolite.repos_path, @group.path) + %span.monospace= File.join(Gitlab.config.gitlab_shell.repos_path, @group.path) %tr %td %b diff --git a/app/views/errors/gitolite.html.haml b/app/views/errors/gitolite.html.haml deleted file mode 100644 index 33ea8c1a8b7..00000000000 --- a/app/views/errors/gitolite.html.haml +++ /dev/null @@ -1,25 +0,0 @@ -%h1.http_status_code 500 -%h3.page_title GitLab was unable to access your Gitolite system. -%hr - -.git_error_tips - %h4 Tips for Administrator: - %ol - %li - %p - Check git logs in admin area - %li - %p - Check config/gitlab.yml for correct settings. - %li - %p - Diagnostic tool: - %pre - bundle exec rake gitlab:check RAILS_ENV=production - %li - %p - Permissions: - %pre - = preserve do - sudo chown -R git:git #{Gitlab.config.gitolite.repos_path} - sudo chmod -R ug+rwXs #{Gitlab.config.gitolite.repos_path} diff --git a/app/workers/gitolite_worker.rb b/app/workers/gitlab_shell_worker.rb index bff7a8c6a6f..0b8a5497111 100644 --- a/app/workers/gitolite_worker.rb +++ b/app/workers/gitlab_shell_worker.rb @@ -2,9 +2,9 @@ class GitoliteWorker include Sidekiq::Worker include Gitolited - sidekiq_options queue: :gitolite + sidekiq_options queue: :gitlab_shell def perform(action, *arg) - gitolite.send(action, *arg) + gitlab_shell.send(action, *arg) end end diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index 6e2d0e7aba2..e3f62d736ef 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -5,10 +5,10 @@ class PostReceive def perform(repo_path, oldrev, newrev, ref, identifier) - if repo_path.start_with?(Gitlab.config.gitolite.repos_path.to_s) - repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "") + if repo_path.start_with?(Gitlab.config.gitlab_shell.repos_path.to_s) + repo_path.gsub!(Gitlab.config.gitlab_shell.repos_path.to_s, "") else - Gitlab::GitLogger.error("POST-RECEIVE: Check gitlab.yml config for correct gitolite.repos_path variable. \"#{Gitlab.config.gitolite.repos_path}\" does not match \"#{repo_path}\"") + Gitlab::GitLogger.error("POST-RECEIVE: Check gitlab.yml config for correct gitlab_shell.repos_path variable. \"#{Gitlab.config.gitlab_shell.repos_path}\" does not match \"#{repo_path}\"") end repo_path.gsub!(/.git$/, "") @@ -22,7 +22,8 @@ class PostReceive end # Ignore push from non-gitlab users - user = if identifier.eql? Gitlab.config.gitolite.admin_key + user = if identifier.nil? + raise identifier.inspect email = project.repository.commit(newrev).author.email rescue nil User.find_by_email(email) if email elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier) |