summaryrefslogtreecommitdiff
path: root/app/uploaders
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-16 13:01:19 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-16 13:01:19 +0000
commitb736a7b15e0a113da72541b8d4f60bd6e0adfb35 (patch)
tree78d27cfb47590f5c30b1ae75de60368c5e269cc9 /app/uploaders
parent9179fcece813d0fe54abb5d7a28874cfa799f9c5 (diff)
parent14032d8eb1a60ae5920286249c1044be2fa27278 (diff)
downloadgitlab-ce-b736a7b15e0a113da72541b8d4f60bd6e0adfb35.tar.gz
Merge branch 'lfs' into 'master'
Git LFS support Part of gitlab-org/gitlab-ce#2955 See merge request !1727
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