Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
6612ca09
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6612ca09
编写于
5月 05, 2016
作者:
J
James Lopez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update repo and wiki repo bundler to use git bundle instead of compressing via tar
上级
773c39cc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
4 deletion
+8
-4
app/services/projects/import_export/export_service.rb
app/services/projects/import_export/export_service.rb
+6
-0
lib/gitlab/import_export/repo_bundler.rb
lib/gitlab/import_export/repo_bundler.rb
+1
-2
lib/gitlab/import_export/wiki_repo_bundler.rb
lib/gitlab/import_export/wiki_repo_bundler.rb
+1
-2
未找到文件。
app/services/projects/import_export/export_service.rb
浏览文件 @
6612ca09
...
...
@@ -4,8 +4,10 @@ module Projects
def
execute
(
options
=
{})
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
))
# TODO handle errors
save_project_tree
bundle_repo
bundle_wiki_repo
save_all
end
...
...
@@ -19,6 +21,10 @@ module Projects
Gitlab
::
ImportExport
::
RepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
end
def
bundle_wiki_repo
Gitlab
::
ImportExport
::
WikiRepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
end
def
save_all
Gitlab
::
ImportExport
::
Saver
.
save
(
storage_path:
@shared
.
export_path
)
end
...
...
lib/gitlab/import_export/repo_bundler.rb
浏览文件 @
6612ca09
...
...
@@ -20,9 +20,8 @@ module Gitlab
def
bundle_to_disk
FileUtils
.
mkdir_p
(
@export_path
)
tar_cf
(
archive:
full_path
,
dir:
path_to_repo
)
git_bundle
(
repo_path:
path_to_repo
,
bundle_path:
@full_path
)
rescue
#TODO: handle error
false
end
...
...
lib/gitlab/import_export/wiki_repo_bundler.rb
浏览文件 @
6612ca09
...
...
@@ -3,7 +3,7 @@ module Gitlab
class
WikiRepoBundler
<
RepoBundler
def
bundle
@wiki
=
ProjectWiki
.
new
(
@project
)
return
false
if
!
wiki?
return
true
if
!
wiki?
# it's okay to have no Wiki
@full_path
=
File
.
join
(
@export_path
,
project_filename
)
bundle_to_disk
end
...
...
@@ -12,7 +12,6 @@ module Gitlab
FileUtils
.
mkdir_p
(
@export_path
)
git_bundle
(
repo_path:
path_to_repo
,
bundle_path:
@full_path
)
rescue
#TODO: handle error
false
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录