diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-28 17:39:02 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-28 17:39:02 +0200 |
commit | 8b54b7233ef58a2a39da9777dbeab59b4024cc75 (patch) | |
tree | 6dbfd49ba68e1b76930281c20dfff607a681744d /lib | |
parent | 1c5876eb7b2deb069d919bd19b51c9f6218e0f41 (diff) | |
download | gitlab-ce-8b54b7233ef58a2a39da9777dbeab59b4024cc75.tar.gz |
Async perform for add/remove team members
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/backend/gitolite.rb | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/gitlab/backend/gitolite.rb b/lib/gitlab/backend/gitolite.rb index d026b76f5ef..1bcf1264fa9 100644 --- a/lib/gitlab/backend/gitolite.rb +++ b/lib/gitlab/backend/gitolite.rb @@ -22,7 +22,12 @@ module Gitlab end end - def update_repository project_id + # Update project config in gitolite by project id + # + # Ex. + # update_repository(23) + # + def update_repository(project_id) project = Project.find(project_id) config.update_project!(project) end @@ -45,6 +50,19 @@ module Gitlab config.destroy_project!(name) end + # Update projects configs in gitolite by project ids + # + # Ex. + # update_repositories([1, 4, 6]) + # + def update_repositories(project_ids) + projects = Project.where(id: project_ids) + + config.apply do |config| + config.update_projects(projects) + end + end + def url_to_repo path Gitlab.config.gitolite.ssh_path_prefix + "#{path}.git" end @@ -53,12 +71,6 @@ module Gitlab config.admin_all_repo! end - def update_repositories projects - config.apply do |config| - config.update_projects(projects) - end - end - alias_method :create_repository, :update_repository end end |