From 169bdaff7d0351b3c0a8d9937e1d0fcc9f2564bd Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Mon, 12 Feb 2018 15:06:09 +0200 Subject: [GH Import][ci skip] Create an empty wiki if GH project has no content in the wiki --- lib/gitlab/github_import/importer/repository_importer.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/gitlab/github_import/importer/repository_importer.rb b/lib/gitlab/github_import/importer/repository_importer.rb index 7dd68a0d1cd..8231419f54a 100644 --- a/lib/gitlab/github_import/importer/repository_importer.rb +++ b/lib/gitlab/github_import/importer/repository_importer.rb @@ -58,11 +58,16 @@ module Gitlab wiki_url = project.import_url.sub(/\.git\z/, '.wiki.git') storage_path = project.repository_storage_path + if project.wiki_repository_exists? && project.wiki.repository.has_visible_content? + gitlab_shell.remove_repository(storage_path, wiki_path) + end + gitlab_shell.import_repository(storage_path, wiki_path, wiki_url) true rescue Gitlab::Shell::Error => e if e.message !~ /repository not exported/ + project.create_wiki fail_import("Failed to import the wiki: #{e.message}") else true -- cgit v1.2.1