summaryrefslogtreecommitdiff
path: root/app/serializers/diffs_entity.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-18 20:02:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-18 20:02:30 +0000
commit41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch)
tree9c8d89a8624828992f06d892cd2f43818ff5dcc8 /app/serializers/diffs_entity.rb
parent0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff)
downloadgitlab-ce-41fe97390ceddf945f3d967b8fdb3de4c66b7dea.tar.gz
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/serializers/diffs_entity.rb')
-rw-r--r--app/serializers/diffs_entity.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/diffs_entity.rb b/app/serializers/diffs_entity.rb
index e0565a1e506..c818fcd6215 100644
--- a/app/serializers/diffs_entity.rb
+++ b/app/serializers/diffs_entity.rb
@@ -23,7 +23,7 @@ class DiffsEntity < Grape::Entity
CommitEntity.represent(options[:commit], commit_options(options))
end
- expose :context_commits, using: API::Entities::Commit, if: -> (diffs, options) { merge_request&.project&.context_commits_enabled? } do |diffs|
+ expose :context_commits, using: API::Entities::Commit do |diffs|
options[:context_commits]
end
@@ -89,7 +89,7 @@ class DiffsEntity < Grape::Entity
project_blob_path(merge_request.project, merge_request.diff_head_sha)
end
- expose :context_commits_diff, if: -> (_) { merge_request&.project&.context_commits_enabled? } do |diffs, options|
+ expose :context_commits_diff do |diffs, options|
next unless merge_request.context_commits_diff.commits_count > 0
ContextCommitsDiffEntity.represent(