Skip to content

Commit 3091283

Browse files
committed
Correctly remove and re-create satellites when project transfer
Signed-off-by: Dmitriy Zaporozhets <[email protected]>
1 parent 182aa19 commit 3091283

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/services/project_transfer_service.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ def transfer(project, new_namespace)
1818
raise TransferError.new("Project with same path in target namespace already exists")
1919
end
2020

21+
# Remove old satellite
22+
project.satellite.destroy
23+
24+
# Apply new namespace id
2125
project.namespace = new_namespace
2226
project.save!
2327

@@ -29,8 +33,8 @@ def transfer(project, new_namespace)
2933
# Move wiki repo also if present
3034
gitlab_shell.mv_repository("#{old_path}.wiki", "#{new_path}.wiki")
3135

32-
# create satellite repo
33-
project.ensure_satellite_exists
36+
# Create a new satellite (reload project from DB)
37+
Project.find(project.id).ensure_satellite_exists
3438

3539
# clear project cached events
3640
project.reset_events_cache

0 commit comments

Comments
 (0)