Commit 85aeb884 authored by Saverio Miroddi's avatar Saverio Miroddi

Add support for start project to commit cherry-pick description

parent e33608d8
......@@ -251,11 +251,11 @@ class Commit
project.repository.next_branch("cherry-pick-#{short_id}", mild: true)
end
def cherry_pick_description(start_branch_name)
def cherry_pick_description(start_project, start_branch_name)
message_buffer = "(cherry picked from commit #{sha})"
if merge_commit?
compare = CompareService.new(project, sha).execute(project, start_branch_name)
compare = CompareService.new(project, sha).execute(start_project, start_branch_name)
# Ignore the merge commit.
commits_in_merge = compare.commits[0..-2]
......@@ -272,8 +272,8 @@ class Commit
message_buffer
end
def cherry_pick_message(start_branch_name)
%Q{#{message}\n\n#{cherry_pick_description(start_branch_name)}}
def cherry_pick_message(start_project, start_branch_name)
%Q{#{message}\n\n#{cherry_pick_description(start_project, start_branch_name)}}
end
def revert_description(user)
......
......@@ -879,7 +879,7 @@ class Repository
committer = user_to_committer(user)
commit_message = commit.cherry_pick_message(start_branch_name)
commit_message = commit.cherry_pick_message(start_project, start_branch_name)
create_commit(message: commit_message,
author: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment