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
Kazuhiko Shiozaki
gitlab-ce
Commits
4b3afe23
Commit
4b3afe23
authored
Jan 22, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always create merge_request_diff if MR created
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
94865a60
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
3 deletions
+2
-3
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-1
app/models/merge_request.rb
app/models/merge_request.rb
+2
-0
app/observers/merge_request_observer.rb
app/observers/merge_request_observer.rb
+0
-1
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+0
-1
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
4b3afe23
...
...
@@ -76,7 +76,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request
.
author
=
current_user
@target_branches
||=
[]
if
@merge_request
.
save
@merge_request
.
reload_code
redirect_to
[
@merge_request
.
target_project
,
@merge_request
],
notice:
'Merge request was successfully created.'
else
@source_project
=
@merge_request
.
source_project
...
...
app/models/merge_request.rb
View file @
4b3afe23
...
...
@@ -30,7 +30,9 @@ class MergeRequest < ActiveRecord::Base
belongs_to
:target_project
,
foreign_key: :target_project_id
,
class_name:
"Project"
belongs_to
:source_project
,
foreign_key: :source_project_id
,
class_name:
"Project"
has_one
:merge_request_diff
,
dependent: :destroy
after_create
:create_merge_request_diff
delegate
:commits
,
:diffs
,
:last_commit
,
:last_commit_short_sha
,
to: :merge_request_diff
,
prefix:
nil
...
...
app/observers/merge_request_observer.rb
View file @
4b3afe23
...
...
@@ -6,7 +6,6 @@ class MergeRequestObserver < ActivityObserver
create_event
(
merge_request
,
Event
.
determine_action
(
merge_request
))
end
merge_request
.
create_merge_request_diff
notification
.
new_merge_request
(
merge_request
,
current_user
)
merge_request
.
create_cross_references!
(
merge_request
.
project
,
current_user
)
execute_hooks
(
merge_request
)
...
...
lib/api/merge_requests.rb
View file @
4b3afe23
...
...
@@ -88,7 +88,6 @@ module API
end
if
merge_request
.
save
merge_request
.
reload_code
present
merge_request
,
with:
Entities
::
MergeRequest
else
handle_merge_request_errors!
merge_request
.
errors
...
...
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