Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-05-09 12:48:28 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2016-05-09 12:48:28 +0300
commit0a103e983cccc9bb9a7a28fb4eacff8d624010f8 (patch)
treefe2bd0071bccf95cb803e124ed077ba45468cac3 /app
parent7d95d3cde79683fda221e3108d80e7d1fe86e81a (diff)
parent4be77d0b057e3b26f48fbaee947bf8f91a755f41 (diff)
Merge branch 'improve-multiple-branch-push-performance' into 'master'
Improve multiple branch push performance by memoizing permission checking See merge request !4091
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index dfd1e54ecf7..5b556a22755 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -767,7 +767,7 @@ class Project < ActiveRecord::Base
# Check if current branch name is marked as protected in the system
def protected_branch?(branch_name)
- protected_branches.where(name: branch_name).any?
+ protected_branch_names.include?(branch_name)
end
def developers_can_push_to_protected_branch?(branch_name)