diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-01-12 12:41:22 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-01-14 12:09:31 -0200 |
commit | 60f8434a9d7def80e43ca2e1c8e4e3e502856913 (patch) | |
tree | 9845b42d281e3f72200abb0f00933f01aa6b5841 /lib | |
parent | 364e63fa2fb7f1b9dcaab26a674be9b2fcf1ab6b (diff) | |
download | gitlab-ce-60f8434a9d7def80e43ca2e1c8e4e3e502856913.tar.gz |
Refactoring Gitlab::GithubImport::Importer
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/github_import/importer.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/gitlab/github_import/importer.rb b/lib/gitlab/github_import/importer.rb index f75227b4734..18929b9113b 100644 --- a/lib/gitlab/github_import/importer.rb +++ b/lib/gitlab/github_import/importer.rb @@ -14,13 +14,7 @@ module Gitlab end def execute - import_issues - import_pull_requests - import_wiki - - true - rescue Gitlab::Shell::Error - false + import_issues && import_pull_requests && import_wiki end private @@ -39,6 +33,10 @@ module Gitlab end end end + + true + rescue ActiveRecord::RecordInvalid + false end def import_pull_requests @@ -53,6 +51,10 @@ module Gitlab import_comments_on_diff(pull_request.number, merge_request) end end + + true + rescue ActiveRecord::RecordInvalid + false end def import_comments(issue_number, noteable) @@ -78,6 +80,10 @@ module Gitlab gitlab_shell.import_repository(wiki.path_with_namespace, wiki.import_url) project.update_attribute(:wiki_enabled, true) end + + true + rescue Gitlab::Shell::Error + false end end end |