diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 03:09:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 03:09:07 +0300 |
commit | e144369009f3404072f7e0f969f7cded93195a01 (patch) | |
tree | d7a354e2c3c69a7ad65dc81aba8fe2ba59b0a26f /app/serializers | |
parent | d466ee5042520ad078fe050cb078d81dc2ebe196 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/merge_request_diff_entity.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/serializers/merge_request_diff_entity.rb b/app/serializers/merge_request_diff_entity.rb index 5c79b165ee9..aa0ac7d2a7e 100644 --- a/app/serializers/merge_request_diff_entity.rb +++ b/app/serializers/merge_request_diff_entity.rb @@ -34,6 +34,14 @@ class MergeRequestDiffEntity < Grape::Entity merge_request_version_path(project, merge_request, merge_request_diff) end + expose :head_version_path do |merge_request_diff| + project = merge_request.target_project + + next unless project && merge_request.diffable_merge_ref? + + diffs_project_merge_request_path(project, merge_request, diff_head: true) + end + expose :version_path do |merge_request_diff| start_sha = options[:start_sha] project = merge_request.target_project |