提交 05dcb2dd 编写于 作者: S Sean Nichols

Display empty files properly on MR diffs

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册