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
593228ff
Commit
593228ff
authored
Jan 06, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't set invalid @mr_source_branch when create_merge_request?
parent
dea589d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
app/controllers/concerns/creates_commit.rb
app/controllers/concerns/creates_commit.rb
+3
-6
No files found.
app/controllers/concerns/creates_commit.rb
View file @
593228ff
...
...
@@ -91,16 +91,13 @@ module CreatesCommit
@mr_source_project
!=
@mr_target_project
end
def
different_branch?
@mr_source_branch
!=
@mr_target_branch
||
different_project?
end
def
create_merge_request?
params
[
:create_merge_request
].
present?
&&
different_branch?
params
[
:create_merge_request
].
present?
end
# TODO: We should really clean this up
def
set_commit_variables
@mr_source_branch
||=
@target_branch
@mr_source_branch
=
@target_branch
unless
create_merge_request?
if
can?
(
current_user
,
:push_code
,
@project
)
# Edit file in this project
...
...
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