diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-11 16:22:51 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-18 12:00:56 +0100 |
commit | 841a7c6897b23957286056498cc3f05ec4330d15 (patch) | |
tree | dba78089ddaa57ce67ac251a1565b17d54fa79b3 /lib | |
parent | 531177757eef772cc7ce5dd3898c3e6803187ed6 (diff) | |
download | gitlab-ce-841a7c6897b23957286056498cc3f05ec4330d15.tar.gz |
Store and show reason why import failed.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/backend/shell.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb index 01b8bda05c6..87ac30b5ffe 100644 --- a/lib/gitlab/backend/shell.rb +++ b/lib/gitlab/backend/shell.rb @@ -1,6 +1,6 @@ module Gitlab class Shell - class AccessDenied < StandardError; end + class Error < StandardError; end class KeyAdder < Struct.new(:io) def add_key(id, key) @@ -36,8 +36,9 @@ module Gitlab # import_repository("gitlab/gitlab-ci", "https://github.com/randx/six.git") # def import_repository(name, url) - Gitlab::Utils.system_silent([gitlab_shell_projects_path, 'import-project', - "#{name}.git", url, '240']) + output, status = Popen::popen([gitlab_shell_projects_path, 'import-project', "#{name}.git", url, '240']) + raise Error, output unless status.zero? + true end # Move repository |