Read about our upcoming Code of Conduct on this issue

Commit 4cf603c2 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Update project full path in .git/config when renaming a repository

parent b76bd21d4523
......@@ -1420,6 +1420,11 @@ def rename_repo
end
def after_rename_repo
# 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.
write_repository_config(:fullpath, full_path)
path_before_change = previous_changes['path'].first
# We need to check if project had been rolled out to move resource to hashed storage or not and decide
......
......@@ -2626,6 +2626,14 @@ def enable_lfs
project.rename_repo
end
end
it 'updates project full path in .git/config' do
allow(project_storage).to receive(:rename_repo).and_return(true)
expect(project).to receive(:write_repository_config).with(:fullpath, project.full_path)
project.rename_repo
end
end
describe '#pages_path' do
......@@ -2781,6 +2789,12 @@ def enable_lfs
end
end
end
it 'updates project full path in .git/config' do
expect(project).to receive(:write_repository_config).with(:fullpath, project.full_path)
project.rename_repo
end
end
describe '#pages_path' do
......
......@@ -61,7 +61,7 @@
end
end
context 'When project visibility is higher than parent group' do
context 'when project visibility is higher than parent group' do
let(:group) { create(:group, visibility_level: Gitlab::VisibilityLevel::INTERNAL) }
before do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment