Update storage location after a project has been renamed
This commit is contained in:
parent
a0222cf81f
commit
3962c72519
|
@ -81,6 +81,7 @@ module Projects
|
|||
def update_repository_configuration
|
||||
project.reload_repository!
|
||||
project.write_repository_config
|
||||
project.track_project_repository
|
||||
end
|
||||
|
||||
def rename_transferred_documents
|
||||
|
|
|
@ -99,6 +99,17 @@ describe Projects::AfterRenameService do
|
|||
|
||||
expect(rugged_config['gitlab.fullpath']).to eq(project.full_path)
|
||||
end
|
||||
|
||||
it 'updates storage location' do
|
||||
allow(project_storage).to receive(:rename_repo).and_return(true)
|
||||
|
||||
described_class.new(project).execute
|
||||
|
||||
expect(project.project_repository).to have_attributes(
|
||||
disk_path: project.disk_path,
|
||||
shard_name: project.repository_storage
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'using hashed storage' do
|
||||
|
@ -193,6 +204,15 @@ describe Projects::AfterRenameService do
|
|||
|
||||
expect(rugged_config['gitlab.fullpath']).to eq(project.full_path)
|
||||
end
|
||||
|
||||
it 'updates storage location' do
|
||||
described_class.new(project).execute
|
||||
|
||||
expect(project.project_repository).to have_attributes(
|
||||
disk_path: project.disk_path,
|
||||
shard_name: project.repository_storage
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue