Skip to content

Commit 962c6c9

Browse files
author
root
committed
Use map instead of building lists by hand
1 parent 65408c8 commit 962c6c9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Diff for: lib/redmine_git_hosting/patches/projects_controller_patch.rb

+2-7
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,10 @@ def update_projects(message)
108108
projects = @project.self_and_descendants
109109

110110
# Only take projects that have Git repos.
111-
git_projects = projects.uniq.select{|p| p.gitolite_repos.any?}
112-
113-
project_list = []
114-
git_projects.each do |project|
115-
project_list.push(project.id)
116-
end
111+
git_projects = projects.uniq.select{|p| p.gitolite_repos.any?}.map{|project| project.id}
117112

118113
RedmineGitolite::GitHosting.logger.info { message }
119-
RedmineGitolite::GitHosting.resync_gitolite({ :command => :update_projects, :object => project_list })
114+
RedmineGitolite::GitHosting.resync_gitolite({ :command => :update_projects, :object => git_projects })
120115
end
121116

122117

0 commit comments

Comments
 (0)