summaryrefslogtreecommitdiff
path: root/app/controllers/projects/branches_controller.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-05-18 11:06:33 +0100
committerPhil Hughes <me@iamphill.com>2016-06-14 10:09:06 +0100
commitf46c25cd0a189807386e491eae4afc2d3819e24d (patch)
tree706f3829aa852c9e15b03ad614ab814c55a91288 /app/controllers/projects/branches_controller.rb
parent6259deb84f6a69338f789de93117f339c8ee43ba (diff)
downloadgitlab-ce-branches-ui.tar.gz
Added testsbranches-ui
Diffstat (limited to 'app/controllers/projects/branches_controller.rb')
-rw-r--r--app/controllers/projects/branches_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index dd9508da049..1f7a114fc3d 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -8,6 +8,9 @@ class Projects::BranchesController < Projects::ApplicationController
def index
@sort = params[:sort] || 'name'
@branches = @repository.branches_sorted_by(@sort)
+ branch_names = @branches.map(&:name)
+ @protected_branches = @project.protected_branches.where(name: branch_names)
+
@branches = Kaminari.paginate_array(@branches).page(params[:page])
@max_commits = @branches.reduce(0) do |memo, branch|