diff options
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 6a72ed6476e..65264596978 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -2115,6 +2115,18 @@ class MergeRequest < ApplicationRecord !squash && target_project.squash_always? end + def current_patch_id_sha + return merge_request_diff.patch_id_sha if merge_request_diff.patch_id_sha.present? + + base_sha = diff_refs&.base_sha + head_sha = diff_refs&.head_sha + + return unless base_sha && head_sha + return if base_sha == head_sha + + project.repository.get_patch_id(base_sha, head_sha) + end + private attr_accessor :skip_fetch_ref |