summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2015-10-12 16:42:14 +0200
committerMarin Jankovski <maxlazio@gmail.com>2015-11-16 12:39:13 +0100
commit14032d8eb1a60ae5920286249c1044be2fa27278 (patch)
tree78d27cfb47590f5c30b1ae75de60368c5e269cc9 /app/uploaders
parent9179fcece813d0fe54abb5d7a28874cfa799f9c5 (diff)
downloadgitlab-ce-14032d8eb1a60ae5920286249c1044be2fa27278.tar.gz
Add support for git lfs.lfs
Diffstat (limited to 'app/uploaders')
-rw-r--r--app/uploaders/lfs_object_uploader.rb29
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