diff options
author | Stan Hu <stanhu@gmail.com> | 2019-01-17 00:35:40 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-05 21:33:09 -0800 |
commit | a9ab6dbc637bc0a531760b0425d655a507827db3 (patch) | |
tree | 8260d2e0665248e9ce1c4b09f9f64596738dc45d /lib/gitlab/github_import/importer/repository_importer.rb | |
parent | 6bac612dc4545abcbbfc86477417f711e02427ba (diff) | |
download | gitlab-ce-a9ab6dbc637bc0a531760b0425d655a507827db3.tar.gz |
Refactor use of Shell.import_repository for Wikis
The previous behavior would pass in a list of parameters
to Shell, but we can improve this by using the WikiFormatter
and Project models to give us the same information.
Diffstat (limited to 'lib/gitlab/github_import/importer/repository_importer.rb')
-rw-r--r-- | lib/gitlab/github_import/importer/repository_importer.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/gitlab/github_import/importer/repository_importer.rb b/lib/gitlab/github_import/importer/repository_importer.rb index 4126a653b6e..e2dfb00dcc5 100644 --- a/lib/gitlab/github_import/importer/repository_importer.rb +++ b/lib/gitlab/github_import/importer/repository_importer.rb @@ -6,11 +6,12 @@ module Gitlab class RepositoryImporter include Gitlab::ShellAdapter - attr_reader :project, :client + attr_reader :project, :client, :wiki_formatter def initialize(project, client) @project = project @client = client + @wiki_formatter = ::Gitlab::LegacyGithubImport::WikiFormatter.new(project) end # Returns true if we should import the wiki for the project. @@ -57,9 +58,7 @@ module Gitlab end def import_wiki_repository - wiki_path = "#{project.disk_path}.wiki" - - gitlab_shell.import_repository(project.repository_storage, wiki_path, wiki_url, project.full_path) + gitlab_shell.import_wiki_repository(project, wiki_formatter) true rescue Gitlab::Shell::Error => e @@ -72,7 +71,7 @@ module Gitlab end def wiki_url - project.import_url.sub(/\.git\z/, '.wiki.git') + wiki_formatter.import_url end def update_clone_time |