diff options
author | Stan Hu <stanhu@gmail.com> | 2019-01-17 11:35:40 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-06 08:33:09 +0300 |
commit | a9ab6dbc637bc0a531760b0425d655a507827db3 (patch) | |
tree | 8260d2e0665248e9ce1c4b09f9f64596738dc45d /lib/gitlab/legacy_github_import | |
parent | 6bac612dc4545abcbbfc86477417f711e02427ba (diff) |
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/legacy_github_import')
-rw-r--r-- | lib/gitlab/legacy_github_import/importer.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/legacy_github_import/wiki_formatter.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/legacy_github_import/importer.rb b/lib/gitlab/legacy_github_import/importer.rb index ea4e56afb04..f3323c98af2 100644 --- a/lib/gitlab/legacy_github_import/importer.rb +++ b/lib/gitlab/legacy_github_import/importer.rb @@ -267,7 +267,7 @@ module Gitlab def import_wiki unless project.wiki.repository_exists? wiki = WikiFormatter.new(project) - gitlab_shell.import_repository(project.repository_storage, wiki.disk_path, wiki.import_url, project.wiki.full_path) + gitlab_shell.import_wiki_repository(project, wiki) end rescue Gitlab::Shell::Error => e # GitHub error message when the wiki repo has not been created, diff --git a/lib/gitlab/legacy_github_import/wiki_formatter.rb b/lib/gitlab/legacy_github_import/wiki_formatter.rb index ea52be5ee0f..cf1e21ad1e1 100644 --- a/lib/gitlab/legacy_github_import/wiki_formatter.rb +++ b/lib/gitlab/legacy_github_import/wiki_formatter.rb @@ -13,6 +13,10 @@ module Gitlab project.wiki.disk_path end + def full_path + project.wiki.full_path + end + def import_url project.import_url.sub(/\.git\z/, ".wiki.git") end |