Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-01 12:41:52 +0300
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-01 12:41:52 +0300
commit64c8ee47c96d9245081abdf1b9d4ec39cdfc5883 (patch)
treee5eebf2bfef186c7caa6d9b91fae18798657bfaf /lib
parent481644ca7c9f763d4646ad557cc3bcf8f4f71816 (diff)
WIP lazy blobs
Diffstat (limited to 'lib')
-rw-r--r--lib/api/files.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb
index 8ad2c1883c7..c1d86f313b0 100644
--- a/lib/api/files.rb
+++ b/lib/api/files.rb
@@ -58,9 +58,11 @@ module API
commit = user_project.commit(ref)
not_found! 'Commit' unless commit
- blob = user_project.repository.blob_at(commit.sha, file_path)
+ repo = user_project.repository
+ blob = repo.blob_at(commit.sha, file_path)
if blob
+ blob.load_all_data!(repo)
status(200)
{
@@ -72,7 +74,7 @@ module API
ref: ref,
blob_id: blob.id,
commit_id: commit.id,
- last_commit_id: user_project.repository.last_commit_for_path(commit.sha, file_path).id
+ last_commit_id: repo.last_commit_for_path(commit.sha, file_path).id
}
else
not_found! 'File'