Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 13:34:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 13:34:06 +0300
commit859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch)
treed7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /lib/gitlab/import_export/repo_saver.rb
parent446d496a6d000c73a304be52587cd9bbc7493136 (diff)
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'lib/gitlab/import_export/repo_saver.rb')
-rw-r--r--lib/gitlab/import_export/repo_saver.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/gitlab/import_export/repo_saver.rb b/lib/gitlab/import_export/repo_saver.rb
index 898cd7898ba..0fdd0722b65 100644
--- a/lib/gitlab/import_export/repo_saver.rb
+++ b/lib/gitlab/import_export/repo_saver.rb
@@ -5,12 +5,11 @@ module Gitlab
class RepoSaver
include Gitlab::ImportExport::CommandLineUtil
- attr_reader :project, :repository, :shared
+ attr_reader :exportable, :shared
- def initialize(project:, shared:)
- @project = project
+ def initialize(exportable:, shared:)
+ @exportable = exportable
@shared = shared
- @repository = @project.repository
end
def save
@@ -19,6 +18,10 @@ module Gitlab
bundle_to_disk
end
+ def repository
+ @repository ||= @exportable.repository
+ end
+
private
def repository_exists?
@@ -26,11 +29,16 @@ module Gitlab
end
def bundle_full_path
- File.join(shared.export_path, ImportExport.project_bundle_filename)
+ File.join(shared.export_path, bundle_filename)
+ end
+
+ def bundle_filename
+ ::Gitlab::ImportExport.project_bundle_filename
end
def bundle_to_disk
- mkdir_p(shared.export_path)
+ mkdir_p(File.dirname(bundle_full_path))
+
repository.bundle_to_disk(bundle_full_path)
rescue => e
shared.error(e)