Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
f2977c63
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 搜索 >>
未验证
提交
f2977c63
编写于
11月 20, 2017
作者:
N
Nick Thomas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bitbucket wiki import with hashed storage enabled
上级
9414bb00
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
5 deletion
+37
-5
changelogs/unreleased/40292-bitbucket-import-hashed-storage.yml
...logs/unreleased/40292-bitbucket-import-hashed-storage.yml
+5
-0
lib/gitlab/bitbucket_import/importer.rb
lib/gitlab/bitbucket_import/importer.rb
+2
-2
spec/lib/gitlab/bitbucket_import/importer_spec.rb
spec/lib/gitlab/bitbucket_import/importer_spec.rb
+30
-3
未找到文件。
changelogs/unreleased/40292-bitbucket-import-hashed-storage.yml
0 → 100644
浏览文件 @
f2977c63
---
title
:
Fix bitbucket wiki import with hashed storage enabled
merge_request
:
15490
author
:
type
:
fixed
lib/gitlab/bitbucket_import/importer.rb
浏览文件 @
f2977c63
...
...
@@ -61,9 +61,9 @@ module Gitlab
def
import_wiki
return
if
project
.
wiki
.
repository_exists?
path_with_namespace
=
"
#{
project
.
full_path
}
.wiki"
disk_path
=
project
.
wiki
.
disk_path
import_url
=
project
.
import_url
.
sub
(
/\.git\z/
,
".git/wiki"
)
gitlab_shell
.
import_repository
(
project
.
repository_storage_path
,
path_with_namespace
,
import_url
)
gitlab_shell
.
import_repository
(
project
.
repository_storage_path
,
disk_path
,
import_url
)
rescue
StandardError
=>
e
errors
<<
{
type: :wiki
,
errors:
e
.
message
}
end
...
...
spec/lib/gitlab/bitbucket_import/importer_spec.rb
浏览文件 @
f2977c63
...
...
@@ -54,11 +54,13 @@ describe Gitlab::BitbucketImport::Importer do
create
(
:project
,
import_source:
project_identifier
,
import_url:
"https://bitbucket.org/
#{
project_identifier
}
.git"
,
import_data_attributes:
{
credentials:
data
}
)
end
let
(
:importer
)
{
described_class
.
new
(
project
)
}
let
(
:gitlab_shell
)
{
double
}
let
(
:issues_statuses_sample_data
)
do
{
...
...
@@ -67,6 +69,10 @@ describe Gitlab::BitbucketImport::Importer do
}
end
before
do
allow
(
importer
).
to
receive
(
:gitlab_shell
)
{
gitlab_shell
}
end
context
'issues statuses'
do
before
do
# HACK: Bitbucket::Representation.const_get('Issue') seems to return ::Issue without this
...
...
@@ -110,15 +116,36 @@ describe Gitlab::BitbucketImport::Importer do
end
it
'maps statuses to open or closed'
do
allow
(
importer
).
to
receive
(
:import_wiki
)
importer
.
execute
expect
(
project
.
issues
.
where
(
state:
"closed"
).
size
).
to
eq
(
5
)
expect
(
project
.
issues
.
where
(
state:
"opened"
).
size
).
to
eq
(
2
)
end
it
'calls import_wiki'
do
expect
(
importer
).
to
receive
(
:import_wiki
)
importer
.
execute
describe
'wiki import'
do
it
'is skipped when the wiki exists'
do
expect
(
project
.
wiki
).
to
receive
(
:repository_exists?
)
{
true
}
expect
(
importer
.
gitlab_shell
).
not_to
receive
(
:import_repository
)
importer
.
execute
expect
(
importer
.
errors
).
to
be_empty
end
it
'imports to the project disk_path'
do
expect
(
project
.
wiki
).
to
receive
(
:repository_exists?
)
{
false
}
expect
(
importer
.
gitlab_shell
).
to
receive
(
:import_repository
).
with
(
project
.
repository_storage_path
,
project
.
wiki
.
disk_path
,
project
.
import_url
+
'/wiki'
)
importer
.
execute
expect
(
importer
.
errors
).
to
be_empty
end
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录