Reverse order of commits in MR cherry-pick message

Also improved the UT for better documenting this change.
This commit is contained in:
Saverio Miroddi 2017-08-21 20:47:18 +02:00
parent b4622c772e
commit 9ec358af7b
2 changed files with 4 additions and 3 deletions

View file

@ -260,7 +260,7 @@ class Commit
if commits_in_merge_request.present?
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}"
end
end

View file

@ -214,7 +214,7 @@ eos
let(:merge_commit) do
merge_request = create(:merge_request,
source_branch: 'feature',
source_branch: 'video',
target_branch: 'master',
source_project: project,
author: user)
@ -238,7 +238,8 @@ eos
(cherry picked from commit #{merge_commit.sha})
0b4bc9a4 Feature added
467dc98f Add new 'videos' directory
88790590 Upload new video file
STR
expect(merge_commit.cherry_pick_message(user)).to include(expected_appended_text)