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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
cb6f34e3
Commit
cb6f34e3
authored
Jul 15, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement update of ref when merge request code is reloaded
parent
2a6f522c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+18
-9
No files found.
app/models/merge_request_diff.rb
View file @
cb6f34e3
...
...
@@ -160,9 +160,17 @@ class MergeRequestDiff < ActiveRecord::Base
private
def
compare_result
@compare_result
||=
begin
source_sha
=
merge_request
.
source_project
.
commit
(
source_branch
).
sha
@compare_result
||=
CompareService
.
new
.
execute
(
merge_request
.
target_project
.
repository
.
fetch_ref
(
merge_request
.
source_project
.
repository
.
path_to_repo
,
"refs/heads/
#{
merge_request
.
source_branch
}
"
,
"refs/merge-requests/
#{
merge_request
.
id
}
/head"
)
CompareService
.
new
.
execute
(
merge_request
.
author
,
merge_request
.
target_project
,
source_sha
,
...
...
@@ -170,4 +178,5 @@ class MergeRequestDiff < ActiveRecord::Base
merge_request
.
target_branch
,
)
end
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