Skip to content
Snippets Groups Projects
Commit 64fe954d authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

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

parent 9504a529
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1420,6 +1420,11 @@ class Project < ActiveRecord::Base
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
Loading
Loading
Loading
Loading
@@ -2626,6 +2626,14 @@ describe Project do
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
Loading
Loading
@@ -2781,6 +2789,12 @@ describe Project do
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
Loading
Loading
Loading
Loading
@@ -61,7 +61,7 @@ describe Projects::UpdateService do
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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment