summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/repo_restorer.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-02-13 16:43:17 +0100
committerJames Lopez <james@jameslopez.es>2017-02-16 10:02:26 +0100
commitb3fb5b4f26b609ad41ccb0837e599fa50c22b55f (patch)
tree1ec8e4696ffe1f0c8b654005db9ea03d977e2481 /lib/gitlab/import_export/repo_restorer.rb
parent01dfedbcad2b8c0988036f9083642a51ee4e9268 (diff)
downloadgitlab-ce-b3fb5b4f26b609ad41ccb0837e599fa50c22b55f.tar.gz
Use gitlab shell import instead of manually creating the webhooks
Also update repo restorer to use project wiki method.
Diffstat (limited to 'lib/gitlab/import_export/repo_restorer.rb')
-rw-r--r--lib/gitlab/import_export/repo_restorer.rb21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/gitlab/import_export/repo_restorer.rb b/lib/gitlab/import_export/repo_restorer.rb
index 48a9a6fa5e2..c824d3ea9fc 100644
--- a/lib/gitlab/import_export/repo_restorer.rb
+++ b/lib/gitlab/import_export/repo_restorer.rb
@@ -2,6 +2,7 @@ module Gitlab
module ImportExport
class RepoRestorer
include Gitlab::ImportExport::CommandLineUtil
+ include Gitlab::ShellAdapter
def initialize(project:, shared:, path_to_bundle:)
@project = project
@@ -12,29 +13,11 @@ module Gitlab
def restore
return true unless File.exist?(@path_to_bundle)
- mkdir_p(path_to_repo)
-
- git_unbundle(repo_path: path_to_repo, bundle_path: @path_to_bundle) && repo_restore_hooks
+ gitlab_shell.import_repository(@project.repository_storage_path, @project.path_with_namespace, @path_to_bundle)
rescue => e
@shared.error(e)
false
end
-
- private
-
- def path_to_repo
- @project.repository.path_to_repo
- end
-
- def repo_restore_hooks
- return true if wiki?
-
- git_restore_hooks
- end
-
- def wiki?
- @project.class.name == 'ProjectWiki'
- end
end
end
end