summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 398a7906dcb..a382db92e8d 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -242,10 +242,7 @@ module API
end
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)
- end
+ options[:project].repository.merged_to_root_ref?(repo_branch, options[:merged_branch_names])
end
expose :protected do |repo_branch, options|
@@ -478,6 +475,10 @@ module API
expose :subscribed do |merge_request, options|
merge_request.subscribed?(options[:current_user], options[:project])
end
+
+ expose :changes_count do |merge_request, _options|
+ merge_request.merge_request_diff.real_size
+ end
end
class MergeRequestChanges < MergeRequest