lib/gitlab_git/diff.rb in gitlab_git-10.3.1 vs lib/gitlab_git/diff.rb in gitlab_git-10.3.2

- old
+ new

@@ -131,11 +131,11 @@ :include_unmodified, :recurse_untracked_dirs, :disable_pathspec_match, :deltas_are_icase, :include_untracked_content, :skip_binary_check, :include_typechange, :include_typechange_trees, :ignore_filemode, :recurse_ignored_dirs, :paths, - :max_files, :max_lines, :all_diffs] + :max_files, :max_lines, :all_diffs, :no_collapse] if default_options actual_defaults = default_options.dup actual_defaults.keep_if do |key| allowed_options.include?(key) @@ -204,9 +204,24 @@ def prune_large_diff! @diff = '' @line_count = 0 @too_large = true + end + + def collapsed? + return @collapsed if defined?(@collapsed) + false + end + + def collapsible? + @diff.bytesize >= 10240 # 10 KB + end + + def prune_collapsed_diff! + @diff = '' + @line_count = 0 + @collapsed = true end private def init_from_rugged(rugged)