diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-02-28 18:08:40 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-03-03 12:13:30 -0300 |
commit | 0b9d56f960e272047ac749cff7a29f2b5f03f7a5 (patch) | |
tree | ec25403e7adef92710f6e37996e4ca3439ee46c6 /lib/api/helpers | |
parent | f9aae510d9d917eda1ad3970f7989fb7d4e74f2c (diff) | |
download | gitlab-ce-28447-hybrid-repository-storages.tar.gz |
Update storage settings to allow extra values per shard28447-hybrid-repository-storages
This will be necessary when adding gitaly settings. This version
doesn't make any functional changes, but allows us to include this
breaking change in 9.0 and add the needed extra settings in the future
with backwards compatibility
Diffstat (limited to 'lib/api/helpers')
-rw-r--r-- | lib/api/helpers/internal_helpers.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb index 080a6274957..2135a787b11 100644 --- a/lib/api/helpers/internal_helpers.rb +++ b/lib/api/helpers/internal_helpers.rb @@ -9,11 +9,11 @@ module API # In addition, they may have a '.git' extension and multiple namespaces # # Transform all these cases to 'namespace/project' - def clean_project_path(project_path, storage_paths = Repository.storages.values) + def clean_project_path(project_path, storages = Gitlab.config.repositories.storages.values) project_path = project_path.sub(/\.git\z/, '') - storage_paths.each do |storage_path| - storage_path = File.expand_path(storage_path) + storages.each do |storage| + storage_path = File.expand_path(storage['path']) if project_path.start_with?(storage_path) project_path = project_path.sub(storage_path, '') |