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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
050178e1
Commit
050178e1
authored
Mar 19, 2020
by
drew cimino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use StrongMemoize for Ci::Build#merge_request
parent
ef4a021f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
app/models/ci/build.rb
app/models/ci/build.rb
+7
-11
No files found.
app/models/ci/build.rb
View file @
050178e1
...
...
@@ -598,19 +598,15 @@ module Ci
end
def
merge_request
return
@merge_request
if
defined?
(
@merge_request
)
strong_memoize
(
:merge_request
)
do
merge_requests
=
MergeRequest
.
includes
(
:latest_merge_request_diff
)
.
where
(
source_branch:
ref
,
source_project:
pipeline
.
project
)
.
reorder
(
iid: :desc
)
@merge_request
||=
begin
merge_requests
=
MergeRequest
.
includes
(
:latest_merge_request_diff
)
.
where
(
source_branch:
ref
,
source_project:
pipeline
.
project
)
.
reorder
(
iid: :desc
)
merge_requests
.
find
do
|
merge_request
|
merge_request
.
commit_shas
.
include?
(
pipeline
.
sha
)
end
merge_requests
.
find
do
|
merge_request
|
merge_request
.
commit_shas
.
include?
(
pipeline
.
sha
)
end
end
end
def
repo_url
...
...
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