提交 85aeb884 编写于 作者: S Saverio Miroddi

Add support for start project to commit cherry-pick description

上级 e33608d8
...@@ -251,11 +251,11 @@ class Commit ...@@ -251,11 +251,11 @@ class Commit
project.repository.next_branch("cherry-pick-#{short_id}", mild: true) project.repository.next_branch("cherry-pick-#{short_id}", mild: true)
end end
def cherry_pick_description(start_branch_name) def cherry_pick_description(start_project, start_branch_name)
message_buffer = "(cherry picked from commit #{sha})" message_buffer = "(cherry picked from commit #{sha})"
if merge_commit? 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. # Ignore the merge commit.
commits_in_merge = compare.commits[0..-2] commits_in_merge = compare.commits[0..-2]
...@@ -272,8 +272,8 @@ class Commit ...@@ -272,8 +272,8 @@ class Commit
message_buffer message_buffer
end end
def cherry_pick_message(start_branch_name) def cherry_pick_message(start_project, start_branch_name)
%Q{#{message}\n\n#{cherry_pick_description(start_branch_name)}} %Q{#{message}\n\n#{cherry_pick_description(start_project, start_branch_name)}}
end end
def revert_description(user) def revert_description(user)
......
...@@ -879,7 +879,7 @@ class Repository ...@@ -879,7 +879,7 @@ class Repository
committer = user_to_committer(user) 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, create_commit(message: commit_message,
author: { author: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册