summaryrefslogtreecommitdiff
path: root/lib/api/files.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-17 11:30:42 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-17 11:30:42 +0100
commita0ccb0731b3598533051067ab24fb007b1d6e44f (patch)
treea380f2d36e66c70235badebd38ec8a0dfa782941 /lib/api/files.rb
parent34a6f83d3e79670774e916e0b38016a74ae9dff1 (diff)
parent300e16065a4fca95ff04de96d31e34f57cf9a4a4 (diff)
downloadgitlab-ce-a0ccb0731b3598533051067ab24fb007b1d6e44f.tar.gz
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into git-archive-refactor
Diffstat (limited to 'lib/api/files.rb')
-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'