Commit 9ec358af authored by Saverio Miroddi's avatar Saverio Miroddi

Reverse order of commits in MR cherry-pick message

Also improved the UT for better documenting this change.
parent b4622c77
...@@ -260,7 +260,7 @@ class Commit ...@@ -260,7 +260,7 @@ class Commit
if commits_in_merge_request.present? if commits_in_merge_request.present?
message_buffer << "\n" message_buffer << "\n"
commits_in_merge_request.each do |commit_in_merge| commits_in_merge_request.reverse.each do |commit_in_merge|
message_buffer << "\n#{commit_in_merge.short_id} #{commit_in_merge.title}" message_buffer << "\n#{commit_in_merge.short_id} #{commit_in_merge.title}"
end end
end end
......
...@@ -214,7 +214,7 @@ eos ...@@ -214,7 +214,7 @@ eos
let(:merge_commit) do let(:merge_commit) do
merge_request = create(:merge_request, merge_request = create(:merge_request,
source_branch: 'feature', source_branch: 'video',
target_branch: 'master', target_branch: 'master',
source_project: project, source_project: project,
author: user) author: user)
...@@ -238,7 +238,8 @@ eos ...@@ -238,7 +238,8 @@ eos
(cherry picked from commit #{merge_commit.sha}) (cherry picked from commit #{merge_commit.sha})
0b4bc9a4 Feature added 467dc98f Add new 'videos' directory
88790590 Upload new video file
STR STR
expect(merge_commit.cherry_pick_message(user)).to include(expected_appended_text) expect(merge_commit.cherry_pick_message(user)).to include(expected_appended_text)
......
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