diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-03-07 14:33:15 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-03-07 14:33:15 +0300 |
commit | 6cfa5ee536c30522241bcf09e805d7eb3adbf481 (patch) | |
tree | 89301502c5cc76bb11cba0ae29cc6df46c97277a /lib/gitlab/diff | |
parent | c45bb62c0ae36018891a343c7c820fc1a901e33e (diff) | |
parent | cea59dbe030bfde83247ef27c49ffd5267b194ea (diff) |
Merge branch 'expand-diff-to-full-file' into 'master'
Expand diff to entire file
Closes #19054
See merge request gitlab-org/gitlab-ce!24406
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r-- | lib/gitlab/diff/file.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index eac9bb88eb6..dbee47a19ee 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -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) |