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
f94b30a3
Commit
f94b30a3
authored
Feb 04, 2020
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix backup restoration whith pre-existing wiki
parent
6b95c3f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
changelogs/unreleased/118783-restoring-wikis-fails.yml
changelogs/unreleased/118783-restoring-wikis-fails.yml
+5
-0
lib/backup/repository.rb
lib/backup/repository.rb
+1
-0
spec/lib/backup/repository_spec.rb
spec/lib/backup/repository_spec.rb
+16
-0
No files found.
changelogs/unreleased/118783-restoring-wikis-fails.yml
0 → 100644
View file @
f94b30a3
---
title
:
Fix backup restoration with pre-existing wiki
merge_request
:
24394
author
:
type
:
fixed
lib/backup/repository.rb
View file @
f94b30a3
...
...
@@ -96,6 +96,7 @@ module Backup
end
wiki
=
ProjectWiki
.
new
(
project
)
wiki
.
repository
.
remove
rescue
nil
path_to_wiki_bundle
=
path_to_bundle
(
wiki
)
if
File
.
exist?
(
path_to_wiki_bundle
)
...
...
spec/lib/backup/repository_spec.rb
View file @
f94b30a3
...
...
@@ -86,6 +86,22 @@ describe Backup::Repository do
expect
(
pool_repository
.
object_pool
.
exists?
).
to
be
(
true
)
end
end
it
'cleans existing repositories'
do
wiki_repository_spy
=
spy
(
:wiki
)
allow_next_instance_of
(
ProjectWiki
)
do
|
project_wiki
|
allow
(
project_wiki
).
to
receive
(
:repository
).
and_return
(
wiki_repository_spy
)
end
expect_next_instance_of
(
Repository
)
do
|
repo
|
expect
(
repo
).
to
receive
(
:remove
)
end
subject
.
restore
expect
(
wiki_repository_spy
).
to
have_received
(
:remove
)
end
end
describe
'#empty_repo?'
do
...
...
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