summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-19 10:55:55 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-07-19 15:19:45 +0200
commita53a4a4309c3aa5cee0ad5f028d9a6255ec5d59e (patch)
tree96f4712b0edb0220cb68e04bf7b22a101f43d5a8 /db
parentcfbb256b8b755e84f8156bc01bc1ba278eeaafa9 (diff)
downloadgitlab-ce-a53a4a4309c3aa5cee0ad5f028d9a6255ec5d59e.tar.gz
Remove direct disk access in RemoveDotGitFromUsernames
Prior to this change, the migration touched the disk path. This has been removed. Further, I believe it also fixes a bug. It seems that GitLab Shell checks if the root path exists, when the path is duplicated. For example, if the shard is located at /home/git, it did check if `/home/git/home/git` existed.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20161226122833_remove_dot_git_from_usernames.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/db/migrate/20161226122833_remove_dot_git_from_usernames.rb b/db/migrate/20161226122833_remove_dot_git_from_usernames.rb
index 133435523e1..db10426b483 100644
--- a/db/migrate/20161226122833_remove_dot_git_from_usernames.rb
+++ b/db/migrate/20161226122833_remove_dot_git_from_usernames.rb
@@ -1,11 +1,7 @@
-# See http://doc.gitlab.com/ce/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
class RemoveDotGitFromUsernames < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
include Gitlab::ShellAdapter
- # Set this constant to true if this migration requires downtime.
DOWNTIME = false
def up
@@ -64,16 +60,14 @@ class RemoveDotGitFromUsernames < ActiveRecord::Migration
# we rename suffix instead of removing it
path = path.sub(/\.git\z/, '_git')
- Gitlab::GitalyClient::StorageSettings.allow_disk_access do
- check_routes(path.dup, 0, path)
- end
+ check_routes(path.dup, 0, path)
end
def check_routes(base, counter, path)
route_exists = route_exists?(path)
- Gitlab.config.repositories.storages.each do |shard, storage|
- if route_exists || path_exists?(shard, storage.legacy_disk_path)
+ Gitlab.config.repositories.storages.each do |shard, _storage|
+ if route_exists || path_exists?(shard, path)
counter += 1
path = "#{base}#{counter}"