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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
cc25c4c0
Commit
cc25c4c0
authored
Mar 17, 2017
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow creating merge request even if target branch is not specified in query params
Closes #28890
parent
7a623907
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
app/services/merge_requests/build_service.rb
app/services/merge_requests/build_service.rb
+1
-1
changelogs/unreleased/28890-allow-creating-mr-without-target-branch-in-url.yml
.../28890-allow-creating-mr-without-target-branch-in-url.yml
+5
-0
spec/features/merge_requests/user_uses_slash_commands_spec.rb
.../features/merge_requests/user_uses_slash_commands_spec.rb
+0
-1
spec/services/merge_requests/build_service_spec.rb
spec/services/merge_requests/build_service_spec.rb
+4
-1
No files found.
app/services/merge_requests/build_service.rb
View file @
cc25c4c0
...
@@ -6,7 +6,7 @@ module MergeRequests
...
@@ -6,7 +6,7 @@ module MergeRequests
merge_request
.
source_project
=
find_source_project
merge_request
.
source_project
=
find_source_project
merge_request
.
target_project
=
find_target_project
merge_request
.
target_project
=
find_target_project
merge_request
.
target_branch
=
find_target_branch
merge_request
.
target_branch
=
find_target_branch
merge_request
.
can_be_created
=
branches_valid?
&&
source_branch_specified?
&&
target_branch_specified?
merge_request
.
can_be_created
=
branches_valid?
compare_branches
if
branches_present?
compare_branches
if
branches_present?
assign_title_and_description
if
merge_request
.
can_be_created
assign_title_and_description
if
merge_request
.
can_be_created
...
...
changelogs/unreleased/28890-allow-creating-mr-without-target-branch-in-url.yml
0 → 100644
View file @
cc25c4c0
---
title
:
Allow creating merge request even if target branch is not specified in query
params
merge_request
:
9968
author
:
spec/features/merge_requests/user_uses_slash_commands_spec.rb
View file @
cc25c4c0
...
@@ -133,7 +133,6 @@ feature 'Merge Requests > User uses slash commands', feature: true, js: true do
...
@@ -133,7 +133,6 @@ feature 'Merge Requests > User uses slash commands', feature: true, js: true do
it
'changes target_branch in new merge_request'
do
it
'changes target_branch in new merge_request'
do
visit
new_namespace_project_merge_request_path
(
another_project
.
namespace
,
another_project
,
new_url_opts
)
visit
new_namespace_project_merge_request_path
(
another_project
.
namespace
,
another_project
,
new_url_opts
)
click_button
"Compare branches and continue"
fill_in
"merge_request_title"
,
with:
'My brand new feature'
fill_in
"merge_request_title"
,
with:
'My brand new feature'
fill_in
"merge_request_description"
,
with:
"le feature
\n
/target_branch fix
\n
Feature description:"
fill_in
"merge_request_description"
,
with:
"le feature
\n
/target_branch fix
\n
Feature description:"
...
...
spec/services/merge_requests/build_service_spec.rb
View file @
cc25c4c0
...
@@ -49,10 +49,13 @@ describe MergeRequests::BuildService, services: true do
...
@@ -49,10 +49,13 @@ describe MergeRequests::BuildService, services: true do
let
(
:commits
)
{
Commit
.
decorate
([
commit_1
],
project
)
}
let
(
:commits
)
{
Commit
.
decorate
([
commit_1
],
project
)
}
it
'creates compare object with target branch as default branch'
do
it
'creates compare object with target branch as default branch'
do
expect
(
merge_request
.
can_be_created
).
to
eq
(
false
)
expect
(
merge_request
.
compare
).
to
be_present
expect
(
merge_request
.
compare
).
to
be_present
expect
(
merge_request
.
target_branch
).
to
eq
(
project
.
default_branch
)
expect
(
merge_request
.
target_branch
).
to
eq
(
project
.
default_branch
)
end
end
it
'allows the merge request to be created'
do
expect
(
merge_request
.
can_be_created
).
to
eq
(
true
)
end
end
end
context
'same source and target branch'
do
context
'same source and target branch'
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