Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
69b750ae
Commit
69b750ae
authored
Feb 19, 2018
by
Valery Sizov
Committed by
Nick Thomas
Feb 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GH Import] Create an empty wiki if wiki import failed
parent
7511e47f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
changelogs/unreleased/4826-github-import-wiki-fix-1.yml
changelogs/unreleased/4826-github-import-wiki-fix-1.yml
+5
-0
lib/gitlab/github_import/importer/repository_importer.rb
lib/gitlab/github_import/importer/repository_importer.rb
+1
-0
spec/lib/gitlab/github_import/importer/repository_importer_spec.rb
...gitlab/github_import/importer/repository_importer_spec.rb
+6
-2
No files found.
changelogs/unreleased/4826-github-import-wiki-fix-1.yml
0 → 100644
View file @
69b750ae
---
title
:
"
[GitHub
Import]
Create
an
empty
wiki
if
wiki
import
failed"
merge_request
:
author
:
type
:
fixed
lib/gitlab/github_import/importer/repository_importer.rb
View file @
69b750ae
...
...
@@ -63,6 +63,7 @@ module Gitlab
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
...
...
spec/lib/gitlab/github_import/importer/repository_importer_spec.rb
View file @
69b750ae
...
...
@@ -11,7 +11,8 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
import_source:
'foo/bar'
,
repository_storage_path:
'foo'
,
disk_path:
'foo'
,
repository:
repository
repository:
repository
,
create_wiki:
true
)
end
...
...
@@ -192,7 +193,7 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
expect
(
importer
.
import_wiki_repository
).
to
eq
(
true
)
end
it
'marks the import as failed if an error was raised'
do
it
'marks the import as failed
and creates an empty repo
if an error was raised'
do
expect
(
importer
.
gitlab_shell
)
.
to
receive
(
:import_repository
)
.
and_raise
(
Gitlab
::
Shell
::
Error
)
...
...
@@ -201,6 +202,9 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do
.
to
receive
(
:fail_import
)
.
and_return
(
false
)
expect
(
project
)
.
to
receive
(
:create_wiki
)
expect
(
importer
.
import_wiki_repository
).
to
eq
(
false
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment