Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 21:25:58 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-16 21:25:58 +0300
commita5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch)
treefb69158581673816a8cd895f9d352dcb3c678b1e /spec/services/commits/cherry_pick_service_spec.rb
parentd16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff)
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/services/commits/cherry_pick_service_spec.rb')
-rw-r--r--spec/services/commits/cherry_pick_service_spec.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/services/commits/cherry_pick_service_spec.rb b/spec/services/commits/cherry_pick_service_spec.rb
index 8fad5164b77..2565e17ac90 100644
--- a/spec/services/commits/cherry_pick_service_spec.rb
+++ b/spec/services/commits/cherry_pick_service_spec.rb
@@ -24,7 +24,7 @@ RSpec.describe Commits::CherryPickService do
repository.add_branch(user, branch_name, merge_base_sha)
end
- def cherry_pick(sha, branch_name)
+ def cherry_pick(sha, branch_name, message: nil)
commit = project.commit(sha)
described_class.new(
@@ -32,7 +32,8 @@ RSpec.describe Commits::CherryPickService do
user,
commit: commit,
start_branch: branch_name,
- branch_name: branch_name
+ branch_name: branch_name,
+ message: message
).execute
end
@@ -45,6 +46,14 @@ RSpec.describe Commits::CherryPickService do
head = repository.find_branch(branch_name).target
expect(head).not_to eq(merge_base_sha)
end
+
+ it 'supports a custom commit message' do
+ result = cherry_pick(merge_commit_sha, branch_name, message: 'foo')
+ branch = repository.find_branch(branch_name)
+
+ expect(result[:status]).to eq(:success)
+ expect(branch.dereferenced_target.message).to eq('foo')
+ end
end
it_behaves_like 'successful cherry-pick'