Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
175f689e
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 搜索 >>
提交
175f689e
编写于
9月 12, 2018
作者:
S
Steve
提交者:
Douwe Maan
9月 12, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initialize projects with readme
上级
d12c81cc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
0 deletion
+15
-0
changelogs/unreleased/21617-initialize-projects-with-readme.yml
...logs/unreleased/21617-initialize-projects-with-readme.yml
+5
-0
doc/api/projects.md
doc/api/projects.md
+1
-0
lib/api/helpers/projects_helpers.rb
lib/api/helpers/projects_helpers.rb
+1
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+8
-0
未找到文件。
changelogs/unreleased/21617-initialize-projects-with-readme.yml
0 → 100644
浏览文件 @
175f689e
---
title
:
Adds a initialize_with_readme parameter to POST /projects
merge_request
:
21617
author
:
Steve
type
:
added
doc/api/projects.md
浏览文件 @
175f689e
...
...
@@ -661,6 +661,7 @@ POST /projects
|
`avatar`
| mixed | no | Image file for avatar of the project |
|
`printing_merge_request_link_enabled`
| boolean | no | Show link to create/view merge request when pushing from the command line |
|
`ci_config_path`
| string | no | The path to CI config file |
|
`initialize_with_readme`
| boolean | no |
`false`
by default |
## Create project for user
...
...
lib/api/helpers/projects_helpers.rb
浏览文件 @
175f689e
...
...
@@ -26,6 +26,7 @@ module API
optional
:avatar
,
type:
File
,
desc:
'Avatar image for project'
optional
:printing_merge_request_link_enabled
,
type:
Boolean
,
desc:
'Show link to create/view merge request when pushing from the command line'
optional
:merge_method
,
type:
String
,
values:
%w(ff rebase_merge merge)
,
desc:
'The merge method used when merging merge requests'
optional
:initialize_with_readme
,
type:
Boolean
,
desc:
"Initialize a project with a README.md"
end
params
:optional_project_params
do
...
...
spec/requests/api/projects_spec.rb
浏览文件 @
175f689e
...
...
@@ -557,6 +557,14 @@ describe API::Projects do
expect
(
json_response
[
'visibility'
]).
to
eq
(
'private'
)
end
it
'creates a new project initialized with a README.md'
do
project
=
attributes_for
(
:project
,
initialize_with_readme:
1
,
name:
'somewhere'
)
post
api
(
'/projects'
,
user
),
project
expect
(
json_response
[
'readme_url'
]).
to
eql
(
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
json_response
[
'namespace'
][
'full_path'
]
}
/somewhere/blob/master/README.md"
)
end
it
'sets tag list to a project'
do
project
=
attributes_for
(
:project
,
tag_list:
%w[tagFirst tagSecond]
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录