summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-23 00:15:48 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-23 00:15:48 +0200
commitfa8f8343745deb7b677a525d12dc69435a98ae21 (patch)
tree7ce9e8a5494338eeb24a183b6be6356cbfbdf55b /lib/tasks
parent9f595aa42f4dd2950579858282cf4414fcd60f42 (diff)
downloadgitlab-ce-fa8f8343745deb7b677a525d12dc69435a98ae21.tar.gz
Fix import rake task and tests
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/import.rake9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/import.rake b/lib/tasks/gitlab/import.rake
index 81f66e2e406..9f1288135c1 100644
--- a/lib/tasks/gitlab/import.rake
+++ b/lib/tasks/gitlab/import.rake
@@ -15,15 +15,20 @@ namespace :gitlab do
git_base_path = Gitlab.config.gitolite.repos_path
repos_to_import = Dir.glob(git_base_path + '/*')
+ namespaces = Namespace.pluck(:path)
+
repos_to_import.each do |repo_path|
repo_name = File.basename repo_path
+ # Skip if group or user
+ next if namespaces.include?(repo_name)
+
# skip gitolite admin
next if repo_name == 'gitolite-admin.git'
path = repo_name.sub(/\.git$/, '')
- project = Project.find_by_path(path)
+ project = Project.find_with_namespace(path)
puts "Processing #{repo_name}".yellow
@@ -34,8 +39,6 @@ namespace :gitlab do
project_params = {
:name => path,
- :code => path,
- :path => path,
}
project = Project.create_by_user(project_params, user)