summaryrefslogtreecommitdiff
path: root/lib/gitlab/git
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/blob.rb8
-rw-r--r--lib/gitlab/git/diff_stats_collection.rb9
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/gitlab/git/blob.rb b/lib/gitlab/git/blob.rb
index 5579449bf57..1b49d356d29 100644
--- a/lib/gitlab/git/blob.rb
+++ b/lib/gitlab/git/blob.rb
@@ -86,12 +86,8 @@ module Gitlab
# to the caller to limit the number of blobs and blob_size_limit.
#
def batch(repository, blob_references, blob_size_limit: MAX_DATA_DISPLAY_SIZE)
- if Feature.enabled?(:blobs_fetch_in_batches, default_enabled: true)
- blob_references.each_slice(BATCH_SIZE).flat_map do |refs|
- repository.gitaly_blob_client.get_blobs(refs, blob_size_limit).to_a
- end
- else
- repository.gitaly_blob_client.get_blobs(blob_references, blob_size_limit).to_a
+ blob_references.each_slice(BATCH_SIZE).flat_map do |refs|
+ repository.gitaly_blob_client.get_blobs(refs, blob_size_limit).to_a
end
end
diff --git a/lib/gitlab/git/diff_stats_collection.rb b/lib/gitlab/git/diff_stats_collection.rb
index 998c41497a2..7e49d79676e 100644
--- a/lib/gitlab/git/diff_stats_collection.rb
+++ b/lib/gitlab/git/diff_stats_collection.rb
@@ -22,6 +22,15 @@ module Gitlab
@collection.map(&:path)
end
+ def real_size
+ max_files = ::Commit.max_diff_options[:max_files]
+ if paths.size > max_files
+ "#{max_files}+"
+ else
+ paths.size.to_s
+ end
+ end
+
private
def indexed_by_path