Commit 9115a4f92f03265253c976ca789f799832ad766f

Authored by GitLab
1 parent b53ca0bc

Remove satellites when moving namespace

Showing 1 changed file with 9 additions and 2 deletions   Show diff stats
app/models/namespace.rb
@@ -71,8 +71,15 @@ class Namespace < ActiveRecord::Base @@ -71,8 +71,15 @@ class Namespace < ActiveRecord::Base
71 if File.exists?(new_path) 71 if File.exists?(new_path)
72 raise "Already exists" 72 raise "Already exists"
73 end 73 end
74 -  
75 - begin 74 +
  75 +
  76 + begin
  77 + # Remove satellite when moving repo
  78 + if path_was.present?
  79 + satellites_path = File.join(Gitlab.config.satellites.path, path_was)
  80 + FileUtils.rm_r( satellites_path, force: true )
  81 + end
  82 +
76 FileUtils.mv( old_path, new_path ) 83 FileUtils.mv( old_path, new_path )
77 send_update_instructions 84 send_update_instructions
78 @require_update_gitolite = true 85 @require_update_gitolite = true