Class: Commits::CommitPatchService

Inherits:
CreateService show all
Defined in:
app/services/commits/commit_patch_service.rb

Constant Summary

Constants inherited from CreateService

Commits::CreateService::ValidationError

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from CreateService

#execute

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(*args) ⇒ CommitPatchService

Requires:

  • project: ‘Project` to be committed into

  • user: ‘User` that will be the committer

  • params:

    • branch_name: ‘String` the branch that will be committed into

    • start_branch: ‘String` the branch that will be started from

    • patches: ‘Gitlab::Git::Patches::Collection` that contains the patches



12
13
14
15
16
# File 'app/services/commits/commit_patch_service.rb', line 12

def initialize(*args)
  super

  @patches = Gitlab::Git::Patches::Collection.new(Array(params[:patches]))
end