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:
authorPhil Hughes <me@iamphill.com>2019-02-28 17:14:15 +0300
committerMark Chao <mchao@gitlab.com>2019-03-06 10:51:44 +0300
commitb14de8e1f519b9b874033f783051814129af176c (patch)
tree05ebee82e8aa39f4d22bef8602107433e006efba /lib/gitlab/diff
parent2609c2a73e8f8efc4fdd5e13c5378ffae7e4f9ef (diff)
Add option to expand diff to full file
The user can also toggle between the diff changes and the full file diff. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/19054
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/file.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb
index c9d89d56884..88340f044c0 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)