summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-10-24 18:14:33 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-10-24 18:14:33 +0200
commitddc4e656fc96d619c652f6d7eb39d61bbed9b9c2 (patch)
tree8332cf2a945e801bd77f2fd7a58dd5d6adc06c0f
parent8157c6b8a557369f875413f506f34d549254de56 (diff)
parent706b6b5acb8e900e3d43e810d83829f9931bb9ec (diff)
downloadgitlab-ce-ddc4e656fc96d619c652f6d7eb39d61bbed9b9c2.tar.gz
Merge pull request #8159 from cirosantilli/fix-rake-import-existing-group
Fix import.rake failed import if project name is also an existing namespace.
-rw-r--r--lib/tasks/gitlab/import.rake12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/tasks/gitlab/import.rake b/lib/tasks/gitlab/import.rake
index 159568f2883..e0297023bfc 100644
--- a/lib/tasks/gitlab/import.rake
+++ b/lib/tasks/gitlab/import.rake
@@ -15,8 +15,6 @@ namespace :gitlab do
git_base_path = Gitlab.config.gitlab_shell.repos_path
repos_to_import = Dir.glob(git_base_path + '/**/*.git')
- namespaces = Namespace.pluck(:path)
-
repos_to_import.each do |repo_path|
# strip repo base path
repo_path[0..git_base_path.length] = ''
@@ -26,12 +24,6 @@ namespace :gitlab do
group_name = File.dirname path
group_name = nil if group_name == '.'
- # Skip if group or user
- if namespaces.include?(name)
- puts "Skipping #{project.name} due to namespace conflict with group or user".yellow
- next
- end
-
puts "Processing #{repo_path}".yellow
if path =~ /\.wiki\Z/
@@ -53,9 +45,9 @@ namespace :gitlab do
# find group namespace
if group_name
- group = Group.find_by(path: group_name)
+ group = Namespace.find_by(path: group_name)
# create group namespace
- if !group
+ unless group
group = Group.new(:name => group_name)
group.path = group_name
group.owner = user