summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-11-06 13:29:17 +0100
committerRémy Coutable <remy@rymai.me>2017-11-06 13:31:23 +0100
commitb20984dea2fbbb20bc2807903115076b2a1de461 (patch)
treec8fa65db75e4b84b85ab70a34769dd08e69f310e /lib/api/entities.rb
parentd77b9715406f027a060f376199dbd1f56dd866b3 (diff)
downloadgitlab-ce-b20984dea2fbbb20bc2807903115076b2a1de461.tar.gz
Improve performance of the /projects/:id/repository/branches API endpoint
Mitigate a N+1 requests to Gitaly problem. Still one left. Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 398a7906dcb..df78e49b8cf 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -244,7 +244,7 @@ module API
expose :merged do |repo_branch, options|
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37442
Gitlab::GitalyClient.allow_n_plus_1_calls do
- options[:project].repository.merged_to_root_ref?(repo_branch.name)
+ options[:project].repository.merged_to_root_ref?(repo_branch.name, options[:merged_branch_names])
end
end