summaryrefslogtreecommitdiff
path: root/app/models/blob.rb
diff options
context:
space:
mode:
authorChristopher Bartz <bartz@dkrz.de>2017-03-07 18:57:30 +0100
committerChristopher Bartz <bartz@dkrz.de>2017-03-13 18:15:19 +0100
commit7849683766e93cfd91e0c864f3deb08500ea35d9 (patch)
tree75c4bdb8a652902ad4117c48399ed2f304e1bc74 /app/models/blob.rb
parent1585608bdcf932b58d301a7943c01ea824ea524e (diff)
downloadgitlab-ce-7849683766e93cfd91e0c864f3deb08500ea35d9.tar.gz
Do not show LFS object when LFS is disabled
Do not display a 404, when a user tries to retrieve the raw content of an LFS file (pointer) if the config option "lfs_enabled" is set to false. Instead, display the LFS pointer file directly.
Diffstat (limited to 'app/models/blob.rb')
-rw-r--r--app/models/blob.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb
index ab92e820335..1376b86fdad 100644
--- a/app/models/blob.rb
+++ b/app/models/blob.rb
@@ -54,9 +54,13 @@ class Blob < SimpleDelegator
UploaderHelper::VIDEO_EXT.include?(extname.downcase.delete('.'))
end
- def to_partial_path
+ def to_partial_path(project)
if lfs_pointer?
- 'download'
+ if project.lfs_enabled?
+ 'download'
+ else
+ 'text'
+ end
elsif image? || svg?
'image'
elsif text?