Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-24 18:07:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-24 18:07:28 +0300
commit8a37720edff0c74579bba2f8f985f37ed49ffa49 (patch)
tree5939d623b38cad881b10da15d8ecf9a7879d4b5d /lib/gitlab/git_access.rb
parentb4e7d9d8392d80b20acd29959c51e488220fd1e2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/git_access.rb')
-rw-r--r--lib/gitlab/git_access.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index 553a10eb054..642a77ced11 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -498,13 +498,23 @@ module Gitlab
end
def check_changes_size
- changes_size = 0
+ changes_size =
+ if Feature.enabled?(:git_access_batched_changes_size, project, default_enabled: :yaml)
+ revs = ['--not', '--all', '--not']
+ revs += changes_list.map { |change| change[:newrev] }
- changes_list.each do |change|
- changes_size += repository.new_blobs(change[:newrev]).sum(&:size)
+ repository.blobs(revs).sum(&:size)
+ else
+ changes_size = 0
- check_size_against_limit(changes_size)
- end
+ changes_list.each do |change|
+ changes_size += repository.new_blobs(change[:newrev]).sum(&:size)
+ end
+
+ changes_size
+ end
+
+ check_size_against_limit(changes_size)
end
def check_size_against_limit(size)