diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2018-03-07 04:34:46 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2018-03-07 04:49:50 +0300 |
commit | c277aac9dc1a72eb8b4584ad217996a9d7daaf14 (patch) | |
tree | bb99e4fa4e2b7b34dbaa2765c40b3b8fe5c0563d /app | |
parent | bc365bd15a0ec0317a4fce71d024397f26ab56c5 (diff) |
Don't do a commit lookup to present the MR entity, just return the sha
The MergeRequestWidgetEntity is used a lot in AJAX requests, and shaving
that git operation will hopefully translate in a performance improvement
Diffstat (limited to 'app')
-rw-r--r-- | app/serializers/merge_request_widget_entity.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/serializers/merge_request_widget_entity.rb b/app/serializers/merge_request_widget_entity.rb index 4e8ef320af2..a3ebec0efc6 100644 --- a/app/serializers/merge_request_widget_entity.rb +++ b/app/serializers/merge_request_widget_entity.rb @@ -38,7 +38,7 @@ class MergeRequestWidgetEntity < IssuableEntity # Diff sha's expose :diff_head_sha do |merge_request| - merge_request.diff_head_sha if merge_request.diff_head_commit + merge_request.diff_head_sha.presence end expose :merge_commit_message |