From 7849683766e93cfd91e0c864f3deb08500ea35d9 Mon Sep 17 00:00:00 2001 From: Christopher Bartz Date: Tue, 7 Mar 2017 18:57:30 +0100 Subject: 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. --- app/models/blob.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/models/blob.rb') 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? -- cgit v1.2.1