diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-02-01 10:41:52 +0100 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-02-01 10:41:52 +0100 |
commit | 64c8ee47c96d9245081abdf1b9d4ec39cdfc5883 (patch) | |
tree | e5eebf2bfef186c7caa6d9b91fae18798657bfaf /lib/api/files.rb | |
parent | 481644ca7c9f763d4646ad557cc3bcf8f4f71816 (diff) | |
download | gitlab-ce-64c8ee47c96d9245081abdf1b9d4ec39cdfc5883.tar.gz |
WIP lazy blobs
Diffstat (limited to 'lib/api/files.rb')
-rw-r--r-- | lib/api/files.rb | 6 |
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' |