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
cbd3ce8f
Commit
cbd3ce8f
authored
Dec 14, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved lfs_blob_ids method into ExtractsPath module
parent
9c132216
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
app/controllers/projects/tree_controller.rb
app/controllers/projects/tree_controller.rb
+1
-3
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+0
-5
lib/extracts_path.rb
lib/extracts_path.rb
+5
-0
No files found.
app/controllers/projects/tree_controller.rb
View file @
cbd3ce8f
...
...
@@ -26,10 +26,8 @@ class Projects::TreeController < Projects::ApplicationController
respond_to
do
|
format
|
format
.
html
do
blob_ids
=
tree
.
blobs
.
map
(
&
:id
)
lfs_blob_ids
@last_commit
=
@repository
.
last_commit_for_path
(
@commit
.
id
,
@tree
.
path
)
||
@commit
@lfs_blob_ids
=
Gitlab
::
Git
::
Blob
.
batch_lfs_pointers
(
@repo
,
blob_ids
).
map
(
&
:id
)
end
format
.
js
do
...
...
app/controllers/projects_controller.rb
View file @
cbd3ce8f
...
...
@@ -404,9 +404,4 @@ class ProjectsController < Projects::ApplicationController
#
redirect_to
request
.
original_url
.
sub
(
/\.git\/?\Z/
,
''
)
if
params
[
:format
]
==
'git'
end
def
lfs_blob_ids
blob_ids
=
tree
.
blobs
.
map
(
&
:id
)
@lfs_blob_ids
=
Gitlab
::
Git
::
Blob
.
batch_lfs_pointers
(
@repo
,
blob_ids
).
map
(
&
:id
)
end
end
lib/extracts_path.rb
View file @
cbd3ce8f
...
...
@@ -135,6 +135,11 @@ module ExtractsPath
@tree
||=
@repo
.
tree
(
@commit
.
id
,
@path
)
end
def
lfs_blob_ids
blob_ids
=
tree
.
blobs
.
map
(
&
:id
)
@lfs_blob_ids
=
Gitlab
::
Git
::
Blob
.
batch_lfs_pointers
(
@project
.
repository
,
blob_ids
).
map
(
&
:id
)
end
private
# overriden in subclasses, do not remove
...
...
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