summaryrefslogtreecommitdiff
path: root/app/models
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/models
parente8b116ab94828b1354cf50934f49f37f3b012da2 (diff)
downloadgitlab-ce-3063225ca289e87c3f590e1722451a1c674e2ac9.tar.gz
Display merge commit SHA in merge widget after merge
Diffstat (limited to 'app/models')
-rw-r--r--app/models/merge_request.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 63c6ada86e1..628c61d5d69 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -1007,6 +1007,10 @@ class MergeRequest < ActiveRecord::Base
@merge_commit ||= project.commit(merge_commit_sha) if merge_commit_sha
end
+ def short_merge_commit_sha
+ Commit.truncate_sha(merge_commit_sha) if merge_commit_sha
+ end
+
def can_be_reverted?(current_user)
return false unless merge_commit