BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
gollum_wiki.rb
app/models/gollum_wiki.rb
+4
-0
repository.rb
lib/backup/repository.rb
+3
-1
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
end
end
def
empty?
pages
.
empty?
end
# Returns an Array of Gitlab WikiPage instances or an
# empty Array if this Wiki has no pages.
def
pages
...
...
lib/backup/repository.rb
View file @
10fac475
...
...
@@ -28,7 +28,9 @@ module Backup
if
File
.
exists?
(
path_to_repo
(
wiki
))
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
else
puts
" [FAILED]"
.
red
...
...
spec/models/gollum_wiki_spec.rb
View file @
10fac475
...
...
@@ -86,6 +86,27 @@ describe GollumWiki do
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
before
do
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