diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-12-13 20:49:05 +0300 |
---|---|---|
committer | Francisco Javier López <fjlopez@gitlab.com> | 2018-12-27 18:51:07 +0300 |
commit | 5a3e6fdff96f50cb293a8c9fe64ccbf59619936f (patch) | |
tree | 2a5d109ec7bfc07336ad7a155f3234ba4e0f6580 /app/models/diff_viewer/server_side.rb | |
parent | 77909a88460bbc864a5f95f3fa66053eb6cab5a8 (diff) |
Fixing image lfs bug and also displaying text lfs
This commit, introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23812,
fixes a problem creating a displaying image diff notes when the image
is stored in LFS. The main problem was that `Gitlab::Diff::File` was
returning an invalid valid in `text?` for this kind of files.
It also fixes a rendering problem with other LFS files, like text
ones. They LFS pointer shouldn't be shown when LFS is enabled
for the project, but they were.
Diffstat (limited to 'app/models/diff_viewer/server_side.rb')
-rw-r--r-- | app/models/diff_viewer/server_side.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/diff_viewer/server_side.rb b/app/models/diff_viewer/server_side.rb index 977204e6c97..0877c9dddec 100644 --- a/app/models/diff_viewer/server_side.rb +++ b/app/models/diff_viewer/server_side.rb @@ -24,5 +24,17 @@ module DiffViewer super end + + private + + def render_error_reason + return super unless render_error == :server_side_but_stored_externally + + if diff_file.external_storage == :lfs + _('it is stored in LFS') + else + _('it is stored externally') + end + end end end |