Correctly remove and re-create satellites when project transfer
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
182aa19e26
commit
30912835e3
1 changed files with 6 additions and 2 deletions
|
@ -18,6 +18,10 @@ class ProjectTransferService
|
|||
raise TransferError.new("Project with same path in target namespace already exists")
|
||||
end
|
||||
|
||||
# Remove old satellite
|
||||
project.satellite.destroy
|
||||
|
||||
# Apply new namespace id
|
||||
project.namespace = new_namespace
|
||||
project.save!
|
||||
|
||||
|
@ -29,8 +33,8 @@ class ProjectTransferService
|
|||
# Move wiki repo also if present
|
||||
gitlab_shell.mv_repository("#{old_path}.wiki", "#{new_path}.wiki")
|
||||
|
||||
# create satellite repo
|
||||
project.ensure_satellite_exists
|
||||
# Create a new satellite (reload project from DB)
|
||||
Project.find(project.id).ensure_satellite_exists
|
||||
|
||||
# clear project cached events
|
||||
project.reset_events_cache
|
||||
|
|
Loading…
Reference in a new issue