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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
10fac475
Commit
10fac475
authored
Oct 11, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wiki_backup' of /home/git/repositories/gitlab/gitlabhq
parents
9fa94cad
cb6a86ed
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
app/models/gollum_wiki.rb
app/models/gollum_wiki.rb
+4
-0
lib/backup/repository.rb
lib/backup/repository.rb
+3
-1
spec/models/gollum_wiki_spec.rb
spec/models/gollum_wiki_spec.rb
+21
-0
No files found.
app/models/gollum_wiki.rb
View file @
10fac475
...
@@ -45,6 +45,10 @@ class GollumWiki
...
@@ -45,6 +45,10 @@ class GollumWiki
end
end
end
end
def
empty?
pages
.
empty?
end
# Returns an Array of Gitlab WikiPage instances or an
# Returns an Array of Gitlab WikiPage instances or an
# empty Array if this Wiki has no pages.
# empty Array if this Wiki has no pages.
def
pages
def
pages
...
...
lib/backup/repository.rb
View file @
10fac475
...
@@ -28,7 +28,9 @@ module Backup
...
@@ -28,7 +28,9 @@ module Backup
if
File
.
exists?
(
path_to_repo
(
wiki
))
if
File
.
exists?
(
path_to_repo
(
wiki
))
print
" *
#{
wiki
.
path_with_namespace
}
... "
print
" *
#{
wiki
.
path_with_namespace
}
... "
if
system
(
"cd
#{
path_to_repo
(
wiki
)
}
> /dev/null 2>&1 && git bundle create
#{
path_to_bundle
(
wiki
)
}
--all > /dev/null 2>&1"
)
if
wiki
.
empty?
puts
" [SKIPPED]"
.
cyan
elsif
system
(
"cd
#{
path_to_repo
(
wiki
)
}
> /dev/null 2>&1 && git bundle create
#{
path_to_bundle
(
wiki
)
}
--all > /dev/null 2>&1"
)
puts
" [DONE]"
.
green
puts
" [DONE]"
.
green
else
else
puts
" [FAILED]"
.
red
puts
" [FAILED]"
.
red
...
...
spec/models/gollum_wiki_spec.rb
View file @
10fac475
...
@@ -86,6 +86,27 @@ describe GollumWiki do
...
@@ -86,6 +86,27 @@ describe GollumWiki do
end
end
end
end
describe
"#empty?"
do
context
"when the wiki repository is empty"
do
before
do
Gitlab
::
Shell
.
any_instance
.
stub
(
:add_repository
)
do
create_temp_repo
(
"
#{
Rails
.
root
}
/tmp/test-git-base-path/non-existant.wiki.git"
)
end
project
.
stub
(
:path_with_namespace
).
and_return
(
"non-existant"
)
end
its
(
:empty?
)
{
should
be_true
}
end
context
"when the wiki has pages"
do
before
do
create_page
(
"index"
,
"This is an awesome new Gollum Wiki"
)
end
its
(
:empty?
)
{
should
be_false
}
end
end
describe
"#pages"
do
describe
"#pages"
do
before
do
before
do
create_page
(
"index"
,
"This is an awesome new Gollum Wiki"
)
create_page
(
"index"
,
"This is an awesome new Gollum Wiki"
)
...
...
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