diff options
author | James Lopez <james@jameslopez.es> | 2017-01-16 13:18:54 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-01-16 13:18:54 +0100 |
commit | 40fe772279e28b70115ad3d150d84cac579004f5 (patch) | |
tree | 0d7a9275f6b6eaa605b7a714a1182860cd121b17 | |
parent | 9302fbd08c55dc7a98bc07031ac1f5eb6105cbb0 (diff) | |
download | gitlab-ce-40fe772279e28b70115ad3d150d84cac579004f5.tar.gz |
fix bug in loop
-rw-r--r-- | db/migrate/20161226122833_remove_dot_git_from_usernames.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/db/migrate/20161226122833_remove_dot_git_from_usernames.rb b/db/migrate/20161226122833_remove_dot_git_from_usernames.rb index 479cb544088..4e59cbd8a7f 100644 --- a/db/migrate/20161226122833_remove_dot_git_from_usernames.rb +++ b/db/migrate/20161226122833_remove_dot_git_from_usernames.rb @@ -68,14 +68,12 @@ class RemoveDotGitFromUsernames < ActiveRecord::Migration end 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) counter += 1 path = "#{base}#{counter}" - # Start again unless this is the first storage, - # to make sure no other storages contain the new path already. - return check_route(base, counter, path) unless index.zero? + return check_route(base, counter, path) end end @@ -110,7 +108,5 @@ class RemoveDotGitFromUsernames < ActiveRecord::Migration raise e end end - - path end end |