diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 18:08:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 18:08:59 +0300 |
commit | 23288f62da73fb0e30d8e7ce306665e8fda1b932 (patch) | |
tree | 2baf1339e4d7c7c35d6b8a52cfb90597a5d4cdf1 /app/serializers/diffs_entity.rb | |
parent | 7cc6872401eb487ed20dbb9d455f8bb9c97d9e39 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers/diffs_entity.rb')
-rw-r--r-- | app/serializers/diffs_entity.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/serializers/diffs_entity.rb b/app/serializers/diffs_entity.rb index 88e09ae8c0b..02f78180fb0 100644 --- a/app/serializers/diffs_entity.rb +++ b/app/serializers/diffs_entity.rb @@ -24,6 +24,10 @@ class DiffsEntity < Grape::Entity ) end + expose :context_commits, using: API::Entities::Commit, if: -> (diffs, options) { merge_request&.project&.context_commits_enabled? } do |diffs| + options[:context_commits] + end + expose :merge_request_diff, using: MergeRequestDiffEntity do |diffs| options[:merge_request_diff] end |