summaryrefslogtreecommitdiff
path: root/lib/api/files.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-02-04 13:16:48 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-02-04 13:16:48 +0100
commit6fea7c386ff27e5081ff3532b06f71d29eee956b (patch)
treee1a1035725399135e86a6341c8349dfdab417107 /lib/api/files.rb
parentd231b6b9182ce9f68f267af0a073136c898f6892 (diff)
parente933a50b6b8e7feec76bcc71313c14736967cd7a (diff)
downloadgitlab-ce-6fea7c386ff27e5081ff3532b06f71d29eee956b.tar.gz
Merge remote-tracking branch 'origin/master' into ci-permissions
# Conflicts: # app/views/projects/builds/index.html.haml
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'