summaryrefslogtreecommitdiff
path: root/app/helpers/diff_helper.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-28 09:08:19 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-28 09:08:19 +0000
commit79659fe1fe45f2bdd13cd1a3980fbf1714caad57 (patch)
tree6dc2d9e7a3543d5346337c5056331c70f736e950 /app/helpers/diff_helper.rb
parent6047d21a899cba25dfb554cca1776fed689dc951 (diff)
downloadgitlab-ce-79659fe1fe45f2bdd13cd1a3980fbf1714caad57.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r--app/helpers/diff_helper.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index e430b0f402b..3aa54e3afe9 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -190,10 +190,8 @@ module DiffHelper
end
def render_overflow_warning?(diffs_collection)
- diff_files = diffs_collection.raw_diff_files
-
- diff_files.overflow?.tap do |overflown|
- log_overflow_limits(diff_files)
+ diffs_collection.overflow?.tap do |overflown|
+ log_overflow_limits(diff_files: diffs_collection.raw_diff_files, collection_overflow: overflown)
end
end
@@ -285,12 +283,12 @@ module DiffHelper
conflicts_service.conflicts.files.index_by(&:our_path)
end
- def log_overflow_limits(diff_files)
+ def log_overflow_limits(diff_files:, collection_overflow:)
if diff_files.any?(&:too_large?)
Gitlab::Metrics.add_event(:diffs_overflow_single_file_limits)
end
- Gitlab::Metrics.add_event(:diffs_overflow_collection_limits) if diff_files.overflow?
+ Gitlab::Metrics.add_event(:diffs_overflow_collection_limits) if collection_overflow
Gitlab::Metrics.add_event(:diffs_overflow_max_bytes_limits) if diff_files.overflow_max_bytes?
Gitlab::Metrics.add_event(:diffs_overflow_max_files_limits) if diff_files.overflow_max_files?
Gitlab::Metrics.add_event(:diffs_overflow_max_lines_limits) if diff_files.overflow_max_lines?