users_project.save
end
end
- Gitlab::Gitolite.new.update_repositories(Project.where(id: project_ids))
end
+ GitoliteWorker.perform_async(
+ :update_repositories,
+ project_ids
+ )
+
true
rescue
false
users_project.skip_git = true
users_project.destroy
end
- Gitlab::Gitolite.new.update_repositories(Project.where(id: project_ids))
end
+ GitoliteWorker.perform_async(
+ :update_repositories,
+ project_ids
+ )
+
true
rescue
false
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
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
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
it "should call config update" do
gitolite_config.should_receive(:update_project!)
- gitolite.update_repository project
+ gitolite.update_repository(project.id)
end
end