debian-mirror-gitlab/app/services/commits/cherry_pick_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
578 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2016-06-02 11:05:42 +05:30
module Commits
class CherryPickService < ChangeService
2017-08-17 22:00:37 +05:30
def create_commit!
2020-03-13 15:44:24 +05:30
commit_change(:cherry_pick).tap do |sha|
track_mr_picking(sha)
end
end
private
def track_mr_picking(pick_sha)
merge_request = project.merge_requests.by_merge_commit_sha(@commit.sha).first
return unless merge_request
::SystemNotes::MergeRequestsService.new(
noteable: merge_request,
project: project,
author: current_user
).picked_into_branch(@branch_name, pick_sha)
2016-06-02 11:05:42 +05:30
end
end
end