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:
Diffstat (limited to 'lib/gitlab/git/diff_collection.rb')
-rw-r--r--lib/gitlab/git/diff_collection.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/git/diff_collection.rb b/lib/gitlab/git/diff_collection.rb
index c021268a62a..ae2b9d5339c 100644
--- a/lib/gitlab/git/diff_collection.rb
+++ b/lib/gitlab/git/diff_collection.rb
@@ -35,6 +35,7 @@ module Gitlab
def initialize(iterator, options = {})
@iterator = iterator
+ @generated_files = options.fetch(:generated_files, nil)
@limits = self.class.limits(options)
@enforce_limits = !!options.fetch(:limits, true)
@expanded = !!options.fetch(:expanded, true)
@@ -164,7 +165,10 @@ module Gitlab
i = @array.length
@iterator.each do |raw|
- diff = Gitlab::Git::Diff.new(raw, expanded: expand_diff?)
+ options = { expanded: expand_diff? }
+ options[:generated] = @generated_files.include?(raw.from_path) if @generated_files
+
+ diff = Gitlab::Git::Diff.new(raw, **options)
if raw.overflow_marker
@overflow = true