diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-07-07 17:10:55 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-07-07 18:36:14 +0200 |
commit | 17d7d3de5d9f0515398586b77b122a069da30b65 (patch) | |
tree | 14692aca88a93a4852bbd0f6897900ff90ef21f4 /lib | |
parent | 06b9449224a40cd53dab85dc34c3ee491cd6a97a (diff) | |
download | gitlab-ce-17d7d3de5d9f0515398586b77b122a069da30b65.tar.gz |
Add git_blob_load_all_data feature flag
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/blob.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab/git/blob.rb b/lib/gitlab/git/blob.rb index fd35eab092c..ea386c2ddcb 100644 --- a/lib/gitlab/git/blob.rb +++ b/lib/gitlab/git/blob.rb @@ -175,8 +175,17 @@ module Gitlab return if @data == '' # don't mess with submodule blobs return @data if @loaded_all_data + Gitlab::GitalyClient.migrate(:git_blob_load_all_data) do |is_enabled| + @data = begin + if is_enabled + Gitlab::GitalyClient::Blob.new(repository).get_blob(oid: id, limit: -1).data + else + repository.lookup(id).content + end + end + end + @loaded_all_data = true - @data = repository.lookup(id).content @loaded_size = @data.bytesize @binary = nil end |