Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
05dcb2dd
Commit
05dcb2dd
authored
Dec 08, 2018
by
Sean Nichols
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display empty files properly on MR diffs
parent
e7a6b841
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
0 deletions
+13
-0
app/assets/javascripts/diffs/components/diff_file.vue
app/assets/javascripts/diffs/components/diff_file.vue
+3
-0
app/serializers/diff_file_entity.rb
app/serializers/diff_file_entity.rb
+1
-0
changelogs/unreleased/54786-mr-empty-file-display.yml
changelogs/unreleased/54786-mr-empty-file-display.yml
+5
-0
lib/gitlab/diff/file.rb
lib/gitlab/diff/file.rb
+4
-0
No files found.
app/assets/javascripts/diffs/components/diff_file.vue
View file @
05dcb2dd
...
...
@@ -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
>
...
...
app/serializers/diff_file_entity.rb
View file @
05dcb2dd
...
...
@@ -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
...
...
changelogs/unreleased/54786-mr-empty-file-display.yml
0 → 100644
View file @
05dcb2dd
---
title
:
Display empty files properly on MR diffs
merge_request
:
author
:
Sean Nichols
type
:
fixed
lib/gitlab/diff/file.rb
View file @
05dcb2dd
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment