diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-28 09:08:19 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-28 09:08:19 +0000 |
commit | 79659fe1fe45f2bdd13cd1a3980fbf1714caad57 (patch) | |
tree | 6dc2d9e7a3543d5346337c5056331c70f736e950 /app/helpers/diff_helper.rb | |
parent | 6047d21a899cba25dfb554cca1776fed689dc951 (diff) | |
download | gitlab-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.rb | 10 |
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? |