Commit 40fe7722 authored by James Lopez's avatar James Lopez

fix bug in loop

parent 9302fbd0
...@@ -68,14 +68,12 @@ class RemoveDotGitFromUsernames < ActiveRecord::Migration ...@@ -68,14 +68,12 @@ class RemoveDotGitFromUsernames < ActiveRecord::Migration
end end
def check_routes(base, counter, path) def check_routes(base, counter, path)
Gitlab.config.repositories.storages.each_with_index do |(_key, storage), index| Gitlab.config.repositories.storages.each_value do |storage|
if route_exists?(path) || path_exists?(path, storage) if route_exists?(path) || path_exists?(path, storage)
counter += 1 counter += 1
path = "#{base}#{counter}" path = "#{base}#{counter}"
# Start again unless this is the first storage, return check_route(base, counter, path)
# to make sure no other storages contain the new path already.
return check_route(base, counter, path) unless index.zero?
end end
end end
...@@ -110,7 +108,5 @@ class RemoveDotGitFromUsernames < ActiveRecord::Migration ...@@ -110,7 +108,5 @@ class RemoveDotGitFromUsernames < ActiveRecord::Migration
raise e raise e
end end
end end
path
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment