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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0f7b3d13
Commit
0f7b3d13
authored
Sep 01, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-09-01
parents
4a52c1f4
21b7e203
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
0 deletions
+16
-0
changelogs/unreleased/feature--32877-add-default-field-branch-api.yml
...nreleased/feature--32877-add-default-field-branch-api.yml
+5
-0
doc/api/branches.md
doc/api/branches.md
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+4
-0
spec/fixtures/api/schemas/public_api/v4/branch.json
spec/fixtures/api/schemas/public_api/v4/branch.json
+2
-0
No files found.
changelogs/unreleased/feature--32877-add-default-field-branch-api.yml
0 → 100644
View file @
0f7b3d13
---
title
:
Add default parameter to branches API
merge_request
:
21294
author
:
Riccardo Padovani
type
:
changed
doc/api/branches.md
View file @
0f7b3d13
...
...
@@ -27,6 +27,7 @@ Example response:
"name"
:
"master"
,
"merged"
:
false
,
"protected"
:
true
,
"default"
:
true
,
"developers_can_push"
:
false
,
"developers_can_merge"
:
false
,
"can_push"
:
true
,
...
...
@@ -75,6 +76,7 @@ Example response:
"name"
:
"master"
,
"merged"
:
false
,
"protected"
:
true
,
"default"
:
true
,
"developers_can_push"
:
false
,
"developers_can_merge"
:
false
,
"can_push"
:
true
,
...
...
@@ -141,6 +143,7 @@ Example response:
"name"
:
"master"
,
"merged"
:
false
,
"protected"
:
true
,
"default"
:
true
,
"developers_can_push"
:
true
,
"developers_can_merge"
:
true
,
"can_push"
:
true
...
...
@@ -190,6 +193,7 @@ Example response:
"name"
:
"master"
,
"merged"
:
false
,
"protected"
:
false
,
"default"
:
true
,
"developers_can_push"
:
false
,
"developers_can_merge"
:
false
,
"can_push"
:
true
...
...
@@ -234,6 +238,7 @@ Example response:
"name"
:
"newbranch"
,
"merged"
:
false
,
"protected"
:
false
,
"default"
:
false
,
"developers_can_push"
:
false
,
"developers_can_merge"
:
false
,
"can_push"
:
true
...
...
lib/api/entities.rb
View file @
0f7b3d13
...
...
@@ -370,6 +370,10 @@ module API
expose
:can_push
do
|
repo_branch
,
options
|
Gitlab
::
UserAccess
.
new
(
options
[
:current_user
],
project:
options
[
:project
]).
can_push_to_branch?
(
repo_branch
.
name
)
end
expose
:default
do
|
repo_branch
,
options
|
options
[
:project
].
default_branch
==
repo_branch
.
name
end
end
class
TreeObject
<
Grape
::
Entity
...
...
spec/fixtures/api/schemas/public_api/v4/branch.json
View file @
0f7b3d13
...
...
@@ -5,6 +5,7 @@
"commit"
,
"merged"
,
"protected"
,
"default"
,
"developers_can_push"
,
"developers_can_merge"
],
...
...
@@ -13,6 +14,7 @@
"commit"
:
{
"$ref"
:
"commit/basic.json"
},
"merged"
:
{
"type"
:
"boolean"
},
"protected"
:
{
"type"
:
"boolean"
},
"default"
:
{
"type"
:
"boolean"
},
"developers_can_push"
:
{
"type"
:
"boolean"
},
"developers_can_merge"
:
{
"type"
:
"boolean"
},
"can_push"
:
{
"type"
:
"boolean"
}
...
...
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