Write project full path to .git/config when migrating legacy storage

This commit is contained in:
Douglas Barbosa Alexandre 2017-12-19 18:04:48 -02:00
parent ca089f5968
commit 2f2233774c
2 changed files with 14 additions and 1 deletions

View File

@ -39,6 +39,13 @@ module Projects
yield
end
# We'd need to keep track of project full path otherwise directory tree
# created with hashed storage enabled cannot be usefully imported using
# the import rake task.
if result
project.write_repository_config(:fullpath, project.full_path)
end
result
end

View File

@ -2,7 +2,7 @@ require 'spec_helper'
describe Projects::HashedStorage::MigrateRepositoryService do
let(:gitlab_shell) { Gitlab::Shell.new }
let(:project) { create(:project, :empty_repo, :wiki_repo) }
let(:project) { create(:project, :repository, :wiki_repo) }
let(:service) { described_class.new(project) }
let(:legacy_storage) { Storage::LegacyProject.new(project) }
let(:hashed_storage) { Storage::HashedProject.new(project) }
@ -33,6 +33,12 @@ describe Projects::HashedStorage::MigrateRepositoryService do
service.execute
end
it 'writes project full path to .git/config' do
service.execute
expect(project.repo.config['gitlab.fullpath']).to eq project.full_path
end
end
context 'when one move fails' do