From ca089f59687fb8616bcbd3d5501fbc6006893e8f Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Tue, 19 Dec 2017 17:42:51 -0200 Subject: Update project full path in .git/config when renaming namespace --- app/models/namespace.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/models/namespace.rb') 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 -- cgit v1.2.1 From 93eba91df9af083ea80b3b8ab01986efdeec43a0 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Thu, 21 Dec 2017 13:58:36 -0200 Subject: Refactoring Project#write_repository_config --- app/models/namespace.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/namespace.rb') diff --git a/app/models/namespace.rb b/app/models/namespace.rb index d983b2f106b..efbfc607040 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -272,7 +272,7 @@ class Namespace < ActiveRecord::Base 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) + project.write_repository_config end end end -- cgit v1.2.1 From fcb967ac672e224737f6e170693e45331eb4d636 Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Thu, 21 Dec 2017 15:32:08 -0200 Subject: Write projects config to all projects inside namespace in batches --- app/models/namespace.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models/namespace.rb') diff --git a/app/models/namespace.rb b/app/models/namespace.rb index efbfc607040..bdcc9159d26 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -269,8 +269,8 @@ class Namespace < ActiveRecord::Base RedirectRoute.permanent.exists?(path: path) end - def write_projects_full_path_config - all_projects.each do |project| + def write_projects_repository_config + all_projects.find_each do |project| project.expires_full_path_cache # we need to clear cache to validate renames correctly project.write_repository_config end -- cgit v1.2.1