Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
37dc9ee7
Commit
37dc9ee7
authored
Feb 25, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
49f4cdff
5a0629b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
changelogs/unreleased/58020-fix-merge-api-endpoint-param.yml
changelogs/unreleased/58020-fix-merge-api-endpoint-param.yml
+5
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+2
-2
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+15
-0
No files found.
changelogs/unreleased/58020-fix-merge-api-endpoint-param.yml
0 → 100644
View file @
37dc9ee7
---
title
:
Respect the should_remove_source_branch parameter to the merge API
merge_request
:
25525
author
:
type
:
fixed
lib/api/merge_requests.rb
View file @
37dc9ee7
...
@@ -371,11 +371,11 @@ module API
...
@@ -371,11 +371,11 @@ module API
merge_request
.
update
(
squash:
params
[
:squash
])
if
params
[
:squash
]
merge_request
.
update
(
squash:
params
[
:squash
])
if
params
[
:squash
]
merge_params
=
{
merge_params
=
HashWithIndifferentAccess
.
new
(
commit_message:
params
[
:merge_commit_message
],
commit_message:
params
[
:merge_commit_message
],
squash_commit_message:
params
[
:squash_commit_message
],
squash_commit_message:
params
[
:squash_commit_message
],
should_remove_source_branch:
params
[
:should_remove_source_branch
]
should_remove_source_branch:
params
[
:should_remove_source_branch
]
}
)
if
merge_when_pipeline_succeeds
&&
merge_request
.
head_pipeline
&&
merge_request
.
head_pipeline
.
active?
if
merge_when_pipeline_succeeds
&&
merge_request
.
head_pipeline
&&
merge_request
.
head_pipeline
.
active?
::
MergeRequests
::
MergeWhenPipelineSucceedsService
::
MergeRequests
::
MergeWhenPipelineSucceedsService
...
...
spec/requests/api/merge_requests_spec.rb
View file @
37dc9ee7
...
@@ -1005,6 +1005,21 @@ describe API::MergeRequests do
...
@@ -1005,6 +1005,21 @@ describe API::MergeRequests do
expect
(
squash_commit
.
message
).
to
eq
(
merge_request
.
default_squash_commit_message
)
expect
(
squash_commit
.
message
).
to
eq
(
merge_request
.
default_squash_commit_message
)
end
end
end
end
describe
"the should_remove_source_branch param"
do
let
(
:source_repository
)
{
merge_request
.
source_project
.
repository
}
let
(
:source_branch
)
{
merge_request
.
source_branch
}
it
'removes the source branch when set'
do
put
(
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
/merge"
,
user
),
params:
{
should_remove_source_branch:
true
}
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
source_repository
.
branch_exists?
(
source_branch
)).
to
be_falsy
end
end
end
end
describe
"PUT /projects/:id/merge_requests/:merge_request_iid"
do
describe
"PUT /projects/:id/merge_requests/:merge_request_iid"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment