Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-10-05 11:46:30 +0300
committerRémy Coutable <remy@rymai.me>2017-10-05 11:48:26 +0300
commitf50b95b00790794184243062e3cbc9095b8b839d (patch)
tree15806f1cd971c44876eced5e9c3fb277b230ee95 /lib/tasks/import.rake
parenta55e150177934145c3daeecb678cce1b16f0a3b8 (diff)
Ensure the `import:github` task doesn't schedule an import job
The point of this task is to run the import in the foreground, so it shouldn't schedule an import job! Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/tasks/import.rake')
-rw-r--r--lib/tasks/import.rake13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake
index 7243ca85de8..7f86fd7b45e 100644
--- a/lib/tasks/import.rake
+++ b/lib/tasks/import.rake
@@ -59,18 +59,23 @@ class GithubImport
namespace_path, _sep, name = @project_path.rpartition('/')
namespace = find_or_create_namespace(namespace_path)
- Projects::CreateService.new(
+ project = Projects::CreateService.new(
@current_user,
name: name,
path: name,
description: @repo['description'],
namespace_id: namespace.id,
visibility_level: visibility_level,
- import_type: 'github',
- import_source: @repo['full_name'],
- import_url: @repo['clone_url'].sub('://', "://#{@options[:token]}@"),
skip_wiki: @repo['has_wiki']
).execute
+
+ project.update!(
+ import_type: 'github',
+ import_source: @repo['full_name'],
+ import_url: @repo['clone_url'].sub('://', "://#{@options[:token]}@")
+ )
+
+ project
end
end