summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-05-03 17:28:00 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2018-05-07 14:09:47 -0300
commit3063225ca289e87c3f590e1722451a1c674e2ac9 (patch)
treeec42bcdecce8c3064c61e606da059a019e2a95c2 /app/serializers
parente8b116ab94828b1354cf50934f49f37f3b012da2 (diff)
downloadgitlab-ce-3063225ca289e87c3f590e1722451a1c674e2ac9.tar.gz
Display merge commit SHA in merge widget after merge
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/merge_request_widget_entity.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb
index 4a812e39ee1..d0165c148eb 100644
--- a/app/serializers/merge_request_widget_entity.rb
+++ b/app/serializers/merge_request_widget_entity.rb
@@ -2,6 +2,7 @@ class MergeRequestWidgetEntity < IssuableEntity
expose :state
expose :in_progress_merge_commit_sha
expose :merge_commit_sha
+ expose :short_merge_commit_sha
expose :merge_error
expose :merge_params
expose :merge_status
@@ -207,6 +208,12 @@ class MergeRequestWidgetEntity < IssuableEntity
commit_change_content_project_merge_request_path(merge_request.project, merge_request)
end
+ expose :merge_commit_path do |merge_request|
+ if merge_request.merge_commit_sha
+ project_commit_path(merge_request.project, merge_request.merge_commit_sha)
+ end
+ end
+
private
delegate :current_user, to: :request