diff options
Diffstat (limited to 'lib/gitlab/diff/file.rb')
-rw-r--r-- | lib/gitlab/diff/file.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index c9d89d56884..dbee47a19ee 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -75,7 +75,7 @@ module Gitlab end def line_for_position(pos) - return nil unless pos.position_type == 'text' + return unless pos.position_type == 'text' # This method is normally used to find which line the diff was # commented on, and in this context, it's normally the raw diff persisted @@ -329,6 +329,16 @@ module Gitlab lines end + def fully_expanded? + return true if binary? + + lines = diff_lines_for_serializer + + return true if lines.nil? + + lines.none? { |line| line.type.to_s == 'match' } + end + private def total_blob_lines(blob) |