summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_export/repo_restorer.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-05-05 12:39:18 +0200
committerJames Lopez <james@jameslopez.es>2016-05-05 12:39:18 +0200
commit92f4bde427652a33ccb42e93de1cc781289a6c8a (patch)
treeab8330bea2c7733214b74bc57739733135e8377a /lib/gitlab/import_export/repo_restorer.rb
parent43488d277eba15352680d147c47b7e25c96c742c (diff)
downloadgitlab-ce-92f4bde427652a33ccb42e93de1cc781289a6c8a.tar.gz
use git bundle in import and add wiki repo to import
Diffstat (limited to 'lib/gitlab/import_export/repo_restorer.rb')
-rw-r--r--lib/gitlab/import_export/repo_restorer.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/gitlab/import_export/repo_restorer.rb b/lib/gitlab/import_export/repo_restorer.rb
index b34581deeb5..dc45238bf2a 100644
--- a/lib/gitlab/import_export/repo_restorer.rb
+++ b/lib/gitlab/import_export/repo_restorer.rb
@@ -3,19 +3,18 @@ module Gitlab
class RepoRestorer
include Gitlab::ImportExport::CommandLineUtil
- def initialize(project:, path:)
+ def initialize(project:, path_to_bundle: )
@project = project
- # TODO remove magic keyword and move it to a shared config
- @path = File.join(path, 'project.bundle')
+ @path_to_bundle = path_to_bundle
end
def restore
- return false unless File.exists?(@path)
- # Move repos dir to 'repositories.old' dir
+ return true unless File.exists?(@path)
FileUtils.mkdir_p(repos_path)
FileUtils.mkdir_p(path_to_repo)
- untar_xf(archive: @path, dir: path_to_repo)
+
+ git_unbundle(git_bin_path: Gitlab.config.git.bin_path, repo_path: path_to_repo, bundle_path: @path_to_bundle)
end
private