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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
cc324eb4
Commit
cc324eb4
authored
Jun 30, 2016
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that branch and tag names are given in API
parent
b32a6add
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
lib/api/branches.rb
lib/api/branches.rb
+4
-4
lib/api/tags.rb
lib/api/tags.rb
+3
-3
No files found.
lib/api/branches.rb
View file @
cc324eb4
...
@@ -25,7 +25,7 @@ module API
...
@@ -25,7 +25,7 @@ module API
# branch (required) - The name of the branch
# branch (required) - The name of the branch
# Example Request:
# Example Request:
# GET /projects/:id/repository/branches/:branch
# GET /projects/:id/repository/branches/:branch
get
':id/repository/branches/:branch'
,
requirements:
{
branch:
/.
*
/
}
do
get
':id/repository/branches/:branch'
,
requirements:
{
branch:
/.
+
/
}
do
@branch
=
user_project
.
repository
.
branches
.
find
{
|
item
|
item
.
name
==
params
[
:branch
]
}
@branch
=
user_project
.
repository
.
branches
.
find
{
|
item
|
item
.
name
==
params
[
:branch
]
}
not_found!
(
"Branch"
)
unless
@branch
not_found!
(
"Branch"
)
unless
@branch
present
@branch
,
with:
Entities
::
RepoObject
,
project:
user_project
present
@branch
,
with:
Entities
::
RepoObject
,
project:
user_project
...
@@ -39,7 +39,7 @@ module API
...
@@ -39,7 +39,7 @@ module API
# Example Request:
# Example Request:
# PUT /projects/:id/repository/branches/:branch/protect
# PUT /projects/:id/repository/branches/:branch/protect
put
':id/repository/branches/:branch/protect'
,
put
':id/repository/branches/:branch/protect'
,
requirements:
{
branch:
/.
*
/
}
do
requirements:
{
branch:
/.
+
/
}
do
authorize_admin_project
authorize_admin_project
...
@@ -59,7 +59,7 @@ module API
...
@@ -59,7 +59,7 @@ module API
# Example Request:
# Example Request:
# PUT /projects/:id/repository/branches/:branch/unprotect
# PUT /projects/:id/repository/branches/:branch/unprotect
put
':id/repository/branches/:branch/unprotect'
,
put
':id/repository/branches/:branch/unprotect'
,
requirements:
{
branch:
/.
*
/
}
do
requirements:
{
branch:
/.
+
/
}
do
authorize_admin_project
authorize_admin_project
...
@@ -101,7 +101,7 @@ module API
...
@@ -101,7 +101,7 @@ module API
# Example Request:
# Example Request:
# DELETE /projects/:id/repository/branches/:branch
# DELETE /projects/:id/repository/branches/:branch
delete
":id/repository/branches/:branch"
,
delete
":id/repository/branches/:branch"
,
requirements:
{
branch:
/.
*
/
}
do
requirements:
{
branch:
/.
+
/
}
do
authorize_push_project
authorize_push_project
result
=
DeleteBranchService
.
new
(
user_project
,
current_user
).
result
=
DeleteBranchService
.
new
(
user_project
,
current_user
).
execute
(
params
[
:branch
])
execute
(
params
[
:branch
])
...
...
lib/api/tags.rb
View file @
cc324eb4
...
@@ -61,7 +61,7 @@ module API
...
@@ -61,7 +61,7 @@ module API
# tag_name (required) - The name of the tag
# tag_name (required) - The name of the tag
# Example Request:
# Example Request:
# DELETE /projects/:id/repository/tags/:tag
# DELETE /projects/:id/repository/tags/:tag
delete
":id/repository/tags/:tag_name"
,
requirements:
{
tag_name:
/.
*
/
}
do
delete
":id/repository/tags/:tag_name"
,
requirements:
{
tag_name:
/.
+
/
}
do
authorize_push_project
authorize_push_project
result
=
DeleteTagService
.
new
(
user_project
,
current_user
).
result
=
DeleteTagService
.
new
(
user_project
,
current_user
).
execute
(
params
[
:tag_name
])
execute
(
params
[
:tag_name
])
...
@@ -83,7 +83,7 @@ module API
...
@@ -83,7 +83,7 @@ module API
# description (required) - Release notes with markdown support
# description (required) - Release notes with markdown support
# Example Request:
# Example Request:
# POST /projects/:id/repository/tags/:tag_name/release
# POST /projects/:id/repository/tags/:tag_name/release
post
':id/repository/tags/:tag_name/release'
,
requirements:
{
tag_name:
/.
*
/
}
do
post
':id/repository/tags/:tag_name/release'
,
requirements:
{
tag_name:
/.
+
/
}
do
authorize_push_project
authorize_push_project
required_attributes!
[
:description
]
required_attributes!
[
:description
]
result
=
CreateReleaseService
.
new
(
user_project
,
current_user
).
result
=
CreateReleaseService
.
new
(
user_project
,
current_user
).
...
@@ -104,7 +104,7 @@ module API
...
@@ -104,7 +104,7 @@ module API
# description (required) - Release notes with markdown support
# description (required) - Release notes with markdown support
# Example Request:
# Example Request:
# PUT /projects/:id/repository/tags/:tag_name/release
# PUT /projects/:id/repository/tags/:tag_name/release
put
':id/repository/tags/:tag_name/release'
,
requirements:
{
tag_name:
/.
*
/
}
do
put
':id/repository/tags/:tag_name/release'
,
requirements:
{
tag_name:
/.
+
/
}
do
authorize_push_project
authorize_push_project
required_attributes!
[
:description
]
required_attributes!
[
:description
]
result
=
UpdateReleaseService
.
new
(
user_project
,
current_user
).
result
=
UpdateReleaseService
.
new
(
user_project
,
current_user
).
...
...
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