BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2afcc9e9
Commit
2afcc9e9
authored
Jul 25, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create new version of merge request diff on push instead of updating existing one
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
2acb8a30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
merge_request.rb
app/models/merge_request.rb
+8
-3
No files found.
app/models/merge_request.rb
View file @
2afcc9e9
...
...
@@ -10,8 +10,7 @@ class MergeRequest < ActiveRecord::Base
belongs_to
:source_project
,
foreign_key: :source_project_id
,
class_name:
"Project"
belongs_to
:merge_user
,
class_name:
"User"
has_one
:merge_request_diff
,
dependent: :destroy
has_many
:merge_request_diffs
,
dependent: :destroy
has_many
:events
,
as: :target
,
dependent: :destroy
serialize
:merge_params
,
Hash
...
...
@@ -294,7 +293,9 @@ class MergeRequest < ActiveRecord::Base
end
def
reload_diff
return
unless
merge_request_diff
&&
open
?
return
unless
open
?
merge_request_diff
=
merge_request_diffs
.
create
old_diff_refs
=
self
.
diff_refs
...
...
@@ -691,4 +692,8 @@ class MergeRequest < ActiveRecord::Base
def
keep_around_commit
project
.
repository
.
keep_around
(
self
.
merge_commit_sha
)
end
def
merge_request_diff
merge_request_diffs
.
first
end
end
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