Commit 30912835 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Correctly remove and re-create satellites when project transfer

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 182aa19e
...@@ -18,6 +18,10 @@ class ProjectTransferService ...@@ -18,6 +18,10 @@ class ProjectTransferService
raise TransferError.new("Project with same path in target namespace already exists") raise TransferError.new("Project with same path in target namespace already exists")
end end
# Remove old satellite
project.satellite.destroy
# Apply new namespace id
project.namespace = new_namespace project.namespace = new_namespace
project.save! project.save!
...@@ -29,8 +33,8 @@ class ProjectTransferService ...@@ -29,8 +33,8 @@ class ProjectTransferService
# Move wiki repo also if present # Move wiki repo also if present
gitlab_shell.mv_repository("#{old_path}.wiki", "#{new_path}.wiki") gitlab_shell.mv_repository("#{old_path}.wiki", "#{new_path}.wiki")
# create satellite repo # Create a new satellite (reload project from DB)
project.ensure_satellite_exists Project.find(project.id).ensure_satellite_exists
# clear project cached events # clear project cached events
project.reset_events_cache project.reset_events_cache
......
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