Commit 28ba2176 authored by James Lopez's avatar James Lopez

fix issue restoring repo

parent 7204018a
...@@ -3,18 +3,20 @@ module Gitlab ...@@ -3,18 +3,20 @@ module Gitlab
class RepoRestorer class RepoRestorer
include Gitlab::ImportExport::CommandLineUtil include Gitlab::ImportExport::CommandLineUtil
def initialize(project:, path_to_bundle: ) def initialize(project:, path_to_bundle:)
@project = project @project = project
@path_to_bundle = path_to_bundle @path_to_bundle = path_to_bundle
end end
def restore def restore
return true unless File.exists?(@path) return true unless File.exists?(@path_to_bundle)
FileUtils.mkdir_p(repos_path) FileUtils.mkdir_p(repos_path)
FileUtils.mkdir_p(path_to_repo) FileUtils.mkdir_p(path_to_repo)
git_unbundle(git_bin_path: Gitlab.config.git.bin_path, repo_path: path_to_repo, bundle_path: @path_to_bundle) git_unbundle(git_bin_path: Gitlab.config.git.bin_path, repo_path: path_to_repo, bundle_path: @path_to_bundle)
rescue
false
end end
private private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment