diff --git a/app/services/projects/import_export/export_service.rb b/app/services/projects/import_export/export_service.rb index 5d5573cba5c7e0d8717cd6fdda645263359396d3..47ceff18af62481c45cfd4309c697d18a191ac75 100644 --- a/app/services/projects/import_export/export_service.rb +++ b/app/services/projects/import_export/export_service.rb @@ -4,8 +4,10 @@ module Projects def execute(options = {}) @shared = Gitlab::ImportExport::Shared.new(relative_path: File.join(project.path_with_namespace, 'work')) + # TODO handle errors save_project_tree bundle_repo + bundle_wiki_repo save_all end @@ -19,6 +21,10 @@ module Projects Gitlab::ImportExport::RepoBundler.new(project: project, shared: @shared).bundle end + def bundle_wiki_repo + Gitlab::ImportExport::WikiRepoBundler.new(project: project, shared: @shared).bundle + end + def save_all Gitlab::ImportExport::Saver.save(storage_path: @shared.export_path) end diff --git a/lib/gitlab/import_export/repo_bundler.rb b/lib/gitlab/import_export/repo_bundler.rb index e719ee2e9e3c8cf6e13857b8678ceb65c520c0c2..cd871687d763816e7689c0a72a46f356c2860267 100644 --- a/lib/gitlab/import_export/repo_bundler.rb +++ b/lib/gitlab/import_export/repo_bundler.rb @@ -20,9 +20,8 @@ module Gitlab def bundle_to_disk FileUtils.mkdir_p(@export_path) - tar_cf(archive: full_path, dir: path_to_repo) + git_bundle(repo_path: path_to_repo, bundle_path: @full_path) rescue - #TODO: handle error false end diff --git a/lib/gitlab/import_export/wiki_repo_bundler.rb b/lib/gitlab/import_export/wiki_repo_bundler.rb index 7821c6716280947b491b371317464000dc9b5799..17f1530d5a08a713f0ab43619f6c8ff773a950d6 100644 --- a/lib/gitlab/import_export/wiki_repo_bundler.rb +++ b/lib/gitlab/import_export/wiki_repo_bundler.rb @@ -3,7 +3,7 @@ module Gitlab class WikiRepoBundler < RepoBundler def bundle @wiki = ProjectWiki.new(@project) - return false if !wiki? + return true if !wiki? # it's okay to have no Wiki @full_path = File.join(@export_path, project_filename) bundle_to_disk end @@ -12,7 +12,6 @@ module Gitlab FileUtils.mkdir_p(@export_path) git_bundle(repo_path: path_to_repo, bundle_path: @full_path) rescue - #TODO: handle error false end