summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2017-08-17 17:39:18 +0200
committerGabriel Mazetto <brodock@gmail.com>2017-08-22 06:33:20 +0200
commit02737b8508eb3cce6d8c5ece1f2ffb4772c609a5 (patch)
treeb0e74a6e8e9b1322090c051da978633fb2019908 /app/models
parentd17a7be8308b06b7077a7cffc5d258148ee08c87 (diff)
downloadgitlab-ce-02737b8508eb3cce6d8c5ece1f2ffb4772c609a5.tar.gz
Use `@hashed` prefix for hashed paths on disk, to avoid collision with existing ones
Diffstat (limited to 'app/models')
-rw-r--r--app/models/storage/hashed_project.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/storage/hashed_project.rb b/app/models/storage/hashed_project.rb
index 1a10e0e59a8..fae1b64961a 100644
--- a/app/models/storage/hashed_project.rb
+++ b/app/models/storage/hashed_project.rb
@@ -1,7 +1,9 @@
module Storage
class HashedProject
attr_accessor :project
- delegate :namespace, :gitlab_shell, :repository_storage_path, to: :project
+ delegate :gitlab_shell, :repository_storage_path, to: :project
+
+ ROOT_PATH_PREFIX = '@hashed'.freeze
def initialize(project)
@project = project
@@ -11,7 +13,7 @@ module Storage
#
# @return [String] directory where repository is stored
def base_dir
- "#{disk_hash[0..1]}/#{disk_hash[2..3]}" if disk_hash
+ "#{ROOT_PATH_PREFIX}/#{disk_hash[0..1]}/#{disk_hash[2..3]}" if disk_hash
end
# Disk path is used to build repository and project's wiki path on disk