summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab <gitlab@localhost>2013-01-17 12:21:52 +0200
committerGitLab <gitlab@localhost>2013-01-17 12:21:52 +0200
commit9115a4f92f03265253c976ca789f799832ad766f (patch)
tree22950ba78d153e8724d2110e8e7884c4833b907c /app/models
parentb53ca0bcfea0cf9d82084ad9debbc65512103ddd (diff)
downloadgitlab-ce-9115a4f92f03265253c976ca789f799832ad766f.tar.gz
Remove satellites when moving namespace
Diffstat (limited to 'app/models')
-rw-r--r--app/models/namespace.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 89c1f9adb5a..ad04d0ef99b 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -71,8 +71,15 @@ class Namespace < ActiveRecord::Base
if File.exists?(new_path)
raise "Already exists"
end
-
- begin
+
+
+ begin
+ # Remove satellite when moving repo
+ if path_was.present?
+ satellites_path = File.join(Gitlab.config.satellites.path, path_was)
+ FileUtils.rm_r( satellites_path, force: true )
+ end
+
FileUtils.mv( old_path, new_path )
send_update_instructions
@require_update_gitolite = true