Class: MergeRequests::ReloadMergeHeadDiffService

Inherits:
Object
  • Object
show all
Includes:
BaseServiceUtility
Defined in:
app/services/merge_requests/reload_merge_head_diff_service.rb

Instance Method Summary collapse

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

#initialize(merge_request) ⇒ ReloadMergeHeadDiffService

Returns a new instance of ReloadMergeHeadDiffService.


7
8
9
# File 'app/services/merge_requests/reload_merge_head_diff_service.rb', line 7

def initialize(merge_request)
  @merge_request = merge_request
end

Instance Method Details

#executeObject


11
12
13
14
15
16
17
18
19
# File 'app/services/merge_requests/reload_merge_head_diff_service.rb', line 11

def execute
  return error("Merge request has no merge ref head.") unless merge_request.merge_ref_head.present?

  error_msg = recreate_merge_head_diff

  return error(error_msg) if error_msg

  success
end