summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2017-12-19 17:42:51 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-01-03 16:13:31 -0200
commitca089f59687fb8616bcbd3d5501fbc6006893e8f (patch)
tree4703188a886083c0b45f47f836b67bfc5fb9a88a /app/models
parentbd90330740e0ea5c0ce0672fd605a463fcdfc898 (diff)
downloadgitlab-ce-ca089f59687fb8616bcbd3d5501fbc6006893e8f.tar.gz
Update project full path in .git/config when renaming namespace
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/storage/legacy_namespace.rb2
-rw-r--r--app/models/namespace.rb7
2 files changed, 9 insertions, 0 deletions
diff --git a/app/models/concerns/storage/legacy_namespace.rb b/app/models/concerns/storage/legacy_namespace.rb
index b3020484738..22b9ef4e338 100644
--- a/app/models/concerns/storage/legacy_namespace.rb
+++ b/app/models/concerns/storage/legacy_namespace.rb
@@ -34,6 +34,8 @@ module Storage
# So we basically we mute exceptions in next actions
begin
send_update_instructions
+ write_projects_full_path_config
+
true
rescue
# Returning false does not rollback after_* transaction but gives
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 0ff169d4531..d983b2f106b 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -268,4 +268,11 @@ class Namespace < ActiveRecord::Base
def namespace_previously_created_with_same_path?
RedirectRoute.permanent.exists?(path: path)
end
+
+ def write_projects_full_path_config
+ all_projects.each do |project|
+ project.expires_full_path_cache # we need to clear cache to validate renames correctly
+ project.write_repository_config(:fullpath, project.full_path)
+ end
+ end
end