summaryrefslogtreecommitdiff
path: root/lib/gitlab/diff/file.rb
diff options
context:
space:
mode:
authorSean Nichols <git@seanich.com>2018-12-08 00:50:56 -0500
committerSean Nichols <git@seanich.com>2018-12-11 23:49:04 -0500
commit05dcb2dd76f2a9890398543f6de1516f5ec0b379 (patch)
treecfa2a54519a7255e97a1d56d091dd780828d7e4a /lib/gitlab/diff/file.rb
parente7a6b841684f9a2929b16176b223ea44bfc26332 (diff)
downloadgitlab-ce-05dcb2dd76f2a9890398543f6de1516f5ec0b379.tar.gz
Display empty files properly on MR diffs
Diffstat (limited to 'lib/gitlab/diff/file.rb')
-rw-r--r--lib/gitlab/diff/file.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb
index 8ba44dff06f..0be463f16a2 100644
--- a/lib/gitlab/diff/file.rb
+++ b/lib/gitlab/diff/file.rb
@@ -245,6 +245,10 @@ module Gitlab
end
# rubocop: enable CodeReuse/ActiveRecord
+ def empty?
+ valid_blobs.map(&:empty?).all?
+ end
+
def raw_binary?
try_blobs(:raw_binary?)
end