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
60a2b3ef
Commit
60a2b3ef
authored
Jul 18, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow empty repos on import/export
parent
240a4aa6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
10 deletions
+5
-10
lib/gitlab/import_export/importer.rb
lib/gitlab/import_export/importer.rb
+1
-2
lib/gitlab/import_export/repo_restorer.rb
lib/gitlab/import_export/repo_restorer.rb
+2
-7
lib/gitlab/import_export/repo_saver.rb
lib/gitlab/import_export/repo_saver.rb
+1
-1
lib/gitlab/import_export/wiki_repo_saver.rb
lib/gitlab/import_export/wiki_repo_saver.rb
+1
-0
No files found.
lib/gitlab/import_export/importer.rb
View file @
60a2b3ef
...
...
@@ -44,8 +44,7 @@ module Gitlab
def
wiki_restorer
Gitlab
::
ImportExport
::
RepoRestorer
.
new
(
path_to_bundle:
wiki_repo_path
,
shared:
@shared
,
project:
ProjectWiki
.
new
(
project_tree
.
restored_project
),
wiki:
true
)
project:
ProjectWiki
.
new
(
project_tree
.
restored_project
))
end
def
uploads_restorer
...
...
lib/gitlab/import_export/repo_restorer.rb
View file @
60a2b3ef
...
...
@@ -3,15 +3,14 @@ module Gitlab
class
RepoRestorer
include
Gitlab
::
ImportExport
::
CommandLineUtil
def
initialize
(
project
:,
shared
:,
path_to_bundle
:
,
wiki:
false
)
def
initialize
(
project
:,
shared
:,
path_to_bundle
:)
@project
=
project
@path_to_bundle
=
path_to_bundle
@shared
=
shared
@wiki
=
wiki
end
def
restore
return
wiki?
unless
File
.
exist?
(
@path_to_bundle
)
return
true
unless
File
.
exist?
(
@path_to_bundle
)
FileUtils
.
mkdir_p
(
path_to_repo
)
...
...
@@ -30,10 +29,6 @@ module Gitlab
def
path_to_repo
@project
.
repository
.
path_to_repo
end
def
wiki?
@wiki
end
end
end
end
lib/gitlab/import_export/repo_saver.rb
View file @
60a2b3ef
...
...
@@ -11,7 +11,7 @@ module Gitlab
end
def
save
return
false
if
@project
.
empty_repo?
return
true
if
@project
.
empty_repo?
# it's ok to have no repo
@full_path
=
File
.
join
(
@shared
.
export_path
,
ImportExport
.
project_bundle_filename
)
bundle_to_disk
...
...
lib/gitlab/import_export/wiki_repo_saver.rb
View file @
60a2b3ef
...
...
@@ -4,6 +4,7 @@ module Gitlab
def
save
@wiki
=
ProjectWiki
.
new
(
@project
)
return
true
unless
wiki_repository_exists?
# it's okay to have no Wiki
bundle_to_disk
(
File
.
join
(
@shared
.
export_path
,
project_filename
))
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