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:
authorDouwe Maan <douwe@selenight.nl>2017-05-31 22:41:25 +0300
committerDouwe Maan <douwe@selenight.nl>2017-05-31 22:41:25 +0300
commit04cf618b6ff943527938f64a451a420b494b5a76 (patch)
tree115e9f7bae89e2a1eba453560cbe6ccb551693ba /lib/gitlab/git/diff_collection.rb
parentce869e3964a40b4cf04a803f5201d940ad61b13c (diff)
Change no_limits to limits
Diffstat (limited to 'lib/gitlab/git/diff_collection.rb')
-rw-r--r--lib/gitlab/git/diff_collection.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/git/diff_collection.rb b/lib/gitlab/git/diff_collection.rb
index 9b217b9080d..334e06a6eca 100644
--- a/lib/gitlab/git/diff_collection.rb
+++ b/lib/gitlab/git/diff_collection.rb
@@ -13,7 +13,7 @@ module Gitlab
@safe_max_files = [@max_files, DEFAULT_LIMITS[:max_files]].min
@safe_max_lines = [@max_lines, DEFAULT_LIMITS[:max_lines]].min
@safe_max_bytes = @safe_max_files * 5.kilobytes # Average 5 KB per file
- @no_limits = !!options.fetch(:no_limits, false)
+ @enforce_limits = !!options.fetch(:limits, true)
@expanded = !!options.fetch(:expanded, true)
@line_count = 0
@@ -88,12 +88,12 @@ module Gitlab
@iterator.each do |raw|
@empty = false
- if !@no_limits && i >= @max_files
+ if @enforce_limits && i >= @max_files
@overflow = true
break
end
- expanded = @no_limits || @expanded
+ expanded = !@enforce_limits || @expanded
diff = Gitlab::Git::Diff.new(raw, expanded: expanded)
@@ -104,7 +104,7 @@ module Gitlab
@line_count += diff.line_count
@byte_count += diff.diff.bytesize
- if !@no_limits && (@line_count >= @max_lines || @byte_count >= @max_bytes)
+ if @enforce_limits && (@line_count >= @max_lines || @byte_count >= @max_bytes)
# This last Diff instance pushes us over the lines limit. We stop and
# discard it.
@overflow = true