diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-10-12 17:42:14 +0300 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-11-16 14:39:13 +0300 |
commit | 14032d8eb1a60ae5920286249c1044be2fa27278 (patch) | |
tree | 78d27cfb47590f5c30b1ae75de60368c5e269cc9 /app/uploaders | |
parent | 9179fcece813d0fe54abb5d7a28874cfa799f9c5 (diff) |
Add support for git lfs.
Diffstat (limited to 'app/uploaders')
-rw-r--r-- | app/uploaders/lfs_object_uploader.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/uploaders/lfs_object_uploader.rb b/app/uploaders/lfs_object_uploader.rb new file mode 100644 index 00000000000..28085b31083 --- /dev/null +++ b/app/uploaders/lfs_object_uploader.rb @@ -0,0 +1,29 @@ +# encoding: utf-8 + +class LfsObjectUploader < CarrierWave::Uploader::Base + storage :file + + def store_dir + "#{Gitlab.config.lfs.storage_path}/#{model.oid[0,2]}/#{model.oid[2,2]}" + end + + def cache_dir + "#{Gitlab.config.lfs.storage_path}/tmp/cache" + end + + def move_to_cache + true + end + + def move_to_store + true + end + + def exists? + file.try(:exists?) + end + + def filename + model.oid[4..-1] + end +end |