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
3b504843
Commit
3b504843
authored
Apr 25, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
dcabe624
e7c494cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
changelogs/unreleased/fix-lazy-blobs-requesting-all-previous-blobs.yml
...released/fix-lazy-blobs-requesting-all-previous-blobs.yml
+6
-0
lib/gitlab/gitaly_client/blob_service.rb
lib/gitlab/gitaly_client/blob_service.rb
+2
-2
spec/models/blob_spec.rb
spec/models/blob_spec.rb
+15
-0
No files found.
changelogs/unreleased/fix-lazy-blobs-requesting-all-previous-blobs.yml
0 → 100644
View file @
3b504843
---
title
:
Fix Blob.lazy always loading all previously-requested blobs when a new request
is made
merge_request
:
author
:
type
:
performance
lib/gitlab/gitaly_client/blob_service.rb
View file @
3b504843
...
@@ -55,13 +55,13 @@ module Gitlab
...
@@ -55,13 +55,13 @@ module Gitlab
def
get_blobs
(
revision_paths
,
limit
=
-
1
)
def
get_blobs
(
revision_paths
,
limit
=
-
1
)
return
[]
if
revision_paths
.
empty?
return
[]
if
revision_paths
.
empty?
re
vision_paths
.
map!
do
|
rev
,
path
|
re
quest_revision_paths
=
revision_paths
.
map
do
|
rev
,
path
|
Gitaly
::
GetBlobsRequest
::
RevisionPath
.
new
(
revision:
rev
,
path:
encode_binary
(
path
))
Gitaly
::
GetBlobsRequest
::
RevisionPath
.
new
(
revision:
rev
,
path:
encode_binary
(
path
))
end
end
request
=
Gitaly
::
GetBlobsRequest
.
new
(
request
=
Gitaly
::
GetBlobsRequest
.
new
(
repository:
@gitaly_repo
,
repository:
@gitaly_repo
,
revision_paths:
revision_paths
,
revision_paths:
re
quest_re
vision_paths
,
limit:
limit
limit:
limit
)
)
...
...
spec/models/blob_spec.rb
View file @
3b504843
...
@@ -43,6 +43,21 @@ describe Blob do
...
@@ -43,6 +43,21 @@ describe Blob do
changelog
.
id
changelog
.
id
contributing
.
id
contributing
.
id
end
end
it
'does not include blobs from previous requests in later requests'
do
changelog
=
described_class
.
lazy
(
project
,
commit_id
,
'CHANGELOG'
)
contributing
=
described_class
.
lazy
(
same_project
,
commit_id
,
'CONTRIBUTING.md'
)
# Access property so the values are loaded
changelog
.
id
contributing
.
id
readme
=
described_class
.
lazy
(
project
,
commit_id
,
'README.md'
)
expect
(
project
.
repository
).
to
receive
(
:blobs_at
).
with
([[
commit_id
,
'README.md'
]]).
once
.
and_call_original
readme
.
id
end
end
end
describe
'#data'
do
describe
'#data'
do
...
...
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