Commit 05dcb2dd authored by Sean Nichols's avatar Sean Nichols

Display empty files properly on MR diffs

parent e7a6b841
......@@ -176,6 +176,9 @@ export default {
{{ __('This source diff could not be displayed because it is too large.') }}
<span v-html="viewBlobLink"></span>
</div>
<div v-if="file.empty" class="nothing-here-block">
{{ __('Empty file') }}
</div>
</div>
</template>
......
......@@ -5,6 +5,7 @@ class DiffFileEntity < DiffFileBaseEntity
include IconsHelper
expose :too_large?, as: :too_large
expose :empty?, as: :empty
expose :added_lines
expose :removed_lines
......
---
title: Display empty files properly on MR diffs
merge_request:
author: Sean Nichols
type: fixed
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment