summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2016-09-14 15:15:28 -0300
committerAlejandro Rodríguez <alejorro70@gmail.com>2016-09-14 21:19:24 -0300
commit02bc717f3423b2eb84328f4d908862db10ec76ce (patch)
tree2075430cf3f21772d793ff02e65559fe87011e5f
parent4326690ff82aba0c4288c8dbf615984995e9f465 (diff)
downloadgitlab-ce-fix-old-migration-repos-path-key.tar.gz
Update references to deprecated `repos_path` configuration key to avoidfix-old-migration-repos-path-key
errors on updates from older versions
-rw-r--r--db/migrate/20140502125220_migrate_repo_size.rb5
-rw-r--r--lib/gitlab/import_export/repo_restorer.rb4
2 files changed, 4 insertions, 5 deletions
diff --git a/db/migrate/20140502125220_migrate_repo_size.rb b/db/migrate/20140502125220_migrate_repo_size.rb
index 84463727b3b..e8de7ccf3db 100644
--- a/db/migrate/20140502125220_migrate_repo_size.rb
+++ b/db/migrate/20140502125220_migrate_repo_size.rb
@@ -1,12 +1,15 @@
# rubocop:disable all
class MigrateRepoSize < ActiveRecord::Migration
+ DOWNTIME = false
+
def up
project_data = execute('SELECT projects.id, namespaces.path AS namespace_path, projects.path AS project_path FROM projects LEFT JOIN namespaces ON projects.namespace_id = namespaces.id')
project_data.each do |project|
id = project['id']
namespace_path = project['namespace_path'] || ''
- path = File.join(Gitlab.config.gitlab_shell.repos_path, namespace_path, project['project_path'] + '.git')
+ repos_path = Gitlab.config.gitlab_shell['repos_path'] || Gitlab.config.repositories.storages.default
+ path = File.join(repos_path, namespace_path, project['project_path'] + '.git')
begin
repo = Gitlab::Git::Repository.new(path)
diff --git a/lib/gitlab/import_export/repo_restorer.rb b/lib/gitlab/import_export/repo_restorer.rb
index 6d9379acf25..d1e33ea8678 100644
--- a/lib/gitlab/import_export/repo_restorer.rb
+++ b/lib/gitlab/import_export/repo_restorer.rb
@@ -22,10 +22,6 @@ module Gitlab
private
- def repos_path
- Gitlab.config.gitlab_shell.repos_path
- end
-
def path_to_repo
@project.repository.path_to_repo
end