diff options
-rw-r--r-- | db/migrate/20161226122833_remove_dot_git_from_usernames.rb | 12 | ||||
-rw-r--r-- | spec/migrations/migrate_process_commit_worker_jobs_spec.rb | 8 |
2 files changed, 5 insertions, 15 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}" diff --git a/spec/migrations/migrate_process_commit_worker_jobs_spec.rb b/spec/migrations/migrate_process_commit_worker_jobs_spec.rb index bbb591281d5..6219a67c900 100644 --- a/spec/migrations/migrate_process_commit_worker_jobs_spec.rb +++ b/spec/migrations/migrate_process_commit_worker_jobs_spec.rb @@ -27,7 +27,7 @@ describe MigrateProcessCommitWorkerJobs do end describe '#repository' do - it 'returns a Rugged::Repository' do + it 'returns a mock implemention of ::Repository' do migration_project = described_class::Project .find_including_path(project.id) @@ -83,11 +83,7 @@ describe MigrateProcessCommitWorkerJobs do end it 'encodes data to UTF-8' do - allow_any_instance_of(Rugged::Repository).to receive(:lookup) - .with(commit.id) - .and_return(commit) - - allow(commit).to receive(:message) + allow(commit).to receive(:body) .and_return('김치'.force_encoding('BINARY')) migration.up |