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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
175f689e
Commit
175f689e
authored
Sep 12, 2018
by
Steve
Committed by
Douwe Maan
Sep 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize projects with readme
parent
d12c81cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
0 deletions
+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
No files found.
changelogs/unreleased/21617-initialize-projects-with-readme.yml
0 → 100644
View file @
175f689e
---
title
:
Adds a initialize_with_readme parameter to POST /projects
merge_request
:
21617
author
:
Steve
type
:
added
doc/api/projects.md
View file @
175f689e
...
@@ -661,6 +661,7 @@ POST /projects
...
@@ -661,6 +661,7 @@ POST /projects
|
`avatar`
| mixed | no | Image file for avatar of the project |
|
`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 |
|
`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 |
|
`ci_config_path`
| string | no | The path to CI config file |
|
`initialize_with_readme`
| boolean | no |
`false`
by default |
## Create project for user
## Create project for user
...
...
lib/api/helpers/projects_helpers.rb
View file @
175f689e
...
@@ -26,6 +26,7 @@ module API
...
@@ -26,6 +26,7 @@ module API
optional
:avatar
,
type:
File
,
desc:
'Avatar image for project'
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
: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
: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
end
params
:optional_project_params
do
params
:optional_project_params
do
...
...
spec/requests/api/projects_spec.rb
View file @
175f689e
...
@@ -557,6 +557,14 @@ describe API::Projects do
...
@@ -557,6 +557,14 @@ describe API::Projects do
expect
(
json_response
[
'visibility'
]).
to
eq
(
'private'
)
expect
(
json_response
[
'visibility'
]).
to
eq
(
'private'
)
end
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
it
'sets tag list to a project'
do
project
=
attributes_for
(
:project
,
tag_list:
%w[tagFirst tagSecond]
)
project
=
attributes_for
(
:project
,
tag_list:
%w[tagFirst tagSecond]
)
...
...
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