Class: Commits::CherryPickService
- Inherits:
-
ChangeService
- Object
- BaseService
- CreateService
- ChangeService
- Commits::CherryPickService
- Defined in:
- app/services/commits/cherry_pick_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
- #create_commit! ⇒ Object
-
#initialize(*args) ⇒ CherryPickService
constructor
A new instance of CherryPickService.
Methods inherited from CreateService
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
Constructor Details
#initialize(*args) ⇒ CherryPickService
Returns a new instance of CherryPickService.
5 6 7 8 9 10 |
# File 'app/services/commits/cherry_pick_service.rb', line 5 def initialize(*args) super @start_project = params[:target_project] || @project @source_project = params[:source_project] || @project end |
Instance Method Details
#create_commit! ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/services/commits/cherry_pick_service.rb', line 12 def create_commit! Gitlab::Git::CrossRepo.new(@project.repository, @source_project.repository).execute(@commit.id) do commit_sha = commit_change(:cherry_pick) do || perform_cherry_pick() end track_mr_picking(commit_sha) commit_sha end end |