Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nicholas Bailey
rust-gitlab
Commits
a5f1cb76
Commit
a5f1cb76
authored
May 27, 2020
by
Ben Boeckel
⛰
Browse files
api/projects: escape branch names when unprotecting
parent
42a4c705
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
a5f1cb76
...
...
@@ -22,6 +22,8 @@ been added.
*
The
`api::projects::members::ProjectMembers`
and
`api::projects::repository::Branches`
endpoints now accepts plain strings
for their
`query`
fields.
*
The
`api::projects::protected_branches::UnprotectBranch`
endpoint now
properly escapes branch names with URL-special characters.
## Changes
...
...
src/api/README.md
View file @
a5f1cb76
...
...
@@ -48,7 +48,7 @@ These API endpoints have been implemented.
*
`POST /projects/:project/pipelines/:pipeline/retry`
`projects/pipelines/retry.rs`
*
`GET /projects/:project/pipelines/:pipeline/variables`
`projects/pipelines/variables.rs`
*
`POST /projects/:project/protected_branches`
`projects/protected_branches/protect.rs`
*
`DELETE /projects/:project/protected_branches/
:
branch`
`projects/protected_branches/unprotect.rs`
*
`DELETE /projects/:project/protected_branches/
*
branch`
`projects/protected_branches/unprotect.rs`
*
`GET /projects/:project/repository/branches`
`projects/repository/branches/branches.rs`
*
`POST /projects/:project/repository/branches`
`projects/repository/branches/create.rs`
*
`GET /projects/:project/repository/branches/:branch`
`projects/repository/branches/branch.rs`
...
...
src/api/projects/protected_branches/unprotect.rs
View file @
a5f1cb76
...
...
@@ -8,7 +8,7 @@ use std::borrow::Cow;
use
derive_builder
::
Builder
;
use
crate
::
api
::
common
::
NameOrId
;
use
crate
::
api
::
common
::
{
self
,
NameOrId
}
;
use
crate
::
api
::
endpoint_prelude
::
*
;
/// Create a new file in a project.
...
...
@@ -35,7 +35,12 @@ impl<'a> Endpoint for UnprotectBranch<'a> {
}
fn
endpoint
(
&
self
)
->
Cow
<
'static
,
str
>
{
format!
(
"projects/{}/protected_branches/{}"
,
self
.project
,
self
.name
)
.into
()
format!
(
"projects/{}/protected_branches/{}"
,
self
.project
,
common
::
path_escaped
(
&
self
.name
),
)
.into
()
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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