Skip to content
Snippets Groups Projects
Commit 05dcb2dd authored by Sean Nichols's avatar Sean Nichols
Browse files

Display empty files properly on MR diffs

parent e7a6b841
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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>
 
Loading
Loading
Loading
Loading
@@ -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
 
Loading
Loading
---
title: Display empty files properly on MR diffs
merge_request:
author: Sean Nichols
type: fixed
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment