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
Léo-Paul Géneau
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
Hide 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,14 +160,23 @@ class MergeRequestDiff < ActiveRecord::Base
...
@@ -160,14 +160,23 @@ class MergeRequestDiff < ActiveRecord::Base
private
private
def
compare_result
def
compare_result
source_sha
=
merge_request
.
source_project
.
commit
(
source_branch
).
sha
@compare_result
||=
begin
@compare_result
||=
CompareService
.
new
.
execute
(
source_sha
=
merge_request
.
source_project
.
commit
(
source_branch
).
sha
merge_request
.
author
,
merge_request
.
target_project
,
merge_request
.
target_project
.
repository
.
fetch_ref
(
source_sha
,
merge_request
.
source_project
.
repository
.
path_to_repo
,
merge_request
.
target_project
,
"refs/heads/
#{
merge_request
.
source_branch
}
"
,
merge_request
.
target_branch
,
"refs/merge-requests/
#{
merge_request
.
id
}
/head"
)
)
CompareService
.
new
.
execute
(
merge_request
.
author
,
merge_request
.
target_project
,
source_sha
,
merge_request
.
target_project
,
merge_request
.
target_branch
,
)
end
end
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