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:
authorStan Hu <stanhu@gmail.com>2018-06-11 18:51:56 +0300
committerStan Hu <stanhu@gmail.com>2018-06-11 21:03:17 +0300
commit28871d73ace30f5f21455cd77e38cc743968fd30 (patch)
tree2144da7e439e2c2102fba78767d8a4649e57ae46 /lib/tasks/import.rake
parentf646a8b9bc95fd6cecaa754f7dd0e8370c201502 (diff)
GitHub Rake importer: Fail with a clearer explanation if GitLab username is wrong
Diffstat (limited to 'lib/tasks/import.rake')
-rw-r--r--lib/tasks/import.rake5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tasks/import.rake b/lib/tasks/import.rake
index aafbe52e5f8..1f185dae6fc 100644
--- a/lib/tasks/import.rake
+++ b/lib/tasks/import.rake
@@ -9,7 +9,10 @@ class GithubImport
def initialize(token, gitlab_username, project_path, extras)
@options = { token: token }
@project_path = project_path
- @current_user = User.find_by_username(gitlab_username)
+ @current_user = User.find_by(username: gitlab_username)
+
+ raise "GitLab user #{gitlab_username} not found. Please specify a valid username." unless @current_user
+
@github_repo = extras.empty? ? nil : extras.first
end