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:
...
@@ -27,6 +27,7 @@ Example response:
"name"
:
"master"
,
"name"
:
"master"
,
"merged"
:
false
,
"merged"
:
false
,
"protected"
:
true
,
"protected"
:
true
,
"default"
:
true
,
"developers_can_push"
:
false
,
"developers_can_push"
:
false
,
"developers_can_merge"
:
false
,
"developers_can_merge"
:
false
,
"can_push"
:
true
,
"can_push"
:
true
,
...
@@ -75,6 +76,7 @@ Example response:
...
@@ -75,6 +76,7 @@ Example response:
"name"
:
"master"
,
"name"
:
"master"
,
"merged"
:
false
,
"merged"
:
false
,
"protected"
:
true
,
"protected"
:
true
,
"default"
:
true
,
"developers_can_push"
:
false
,
"developers_can_push"
:
false
,
"developers_can_merge"
:
false
,
"developers_can_merge"
:
false
,
"can_push"
:
true
,
"can_push"
:
true
,
...
@@ -141,6 +143,7 @@ Example response:
...
@@ -141,6 +143,7 @@ Example response:
"name"
:
"master"
,
"name"
:
"master"
,
"merged"
:
false
,
"merged"
:
false
,
"protected"
:
true
,
"protected"
:
true
,
"default"
:
true
,
"developers_can_push"
:
true
,
"developers_can_push"
:
true
,
"developers_can_merge"
:
true
,
"developers_can_merge"
:
true
,
"can_push"
:
true
"can_push"
:
true
...
@@ -190,6 +193,7 @@ Example response:
...
@@ -190,6 +193,7 @@ Example response:
"name"
:
"master"
,
"name"
:
"master"
,
"merged"
:
false
,
"merged"
:
false
,
"protected"
:
false
,
"protected"
:
false
,
"default"
:
true
,
"developers_can_push"
:
false
,
"developers_can_push"
:
false
,
"developers_can_merge"
:
false
,
"developers_can_merge"
:
false
,
"can_push"
:
true
"can_push"
:
true
...
@@ -234,6 +238,7 @@ Example response:
...
@@ -234,6 +238,7 @@ Example response:
"name"
:
"newbranch"
,
"name"
:
"newbranch"
,
"merged"
:
false
,
"merged"
:
false
,
"protected"
:
false
,
"protected"
:
false
,
"default"
:
false
,
"developers_can_push"
:
false
,
"developers_can_push"
:
false
,
"developers_can_merge"
:
false
,
"developers_can_merge"
:
false
,
"can_push"
:
true
"can_push"
:
true
...
...
lib/api/entities.rb
View file @
0f7b3d13
...
@@ -370,6 +370,10 @@ module API
...
@@ -370,6 +370,10 @@ module API
expose
:can_push
do
|
repo_branch
,
options
|
expose
:can_push
do
|
repo_branch
,
options
|
Gitlab
::
UserAccess
.
new
(
options
[
:current_user
],
project:
options
[
:project
]).
can_push_to_branch?
(
repo_branch
.
name
)
Gitlab
::
UserAccess
.
new
(
options
[
:current_user
],
project:
options
[
:project
]).
can_push_to_branch?
(
repo_branch
.
name
)
end
end
expose
:default
do
|
repo_branch
,
options
|
options
[
:project
].
default_branch
==
repo_branch
.
name
end
end
end
class
TreeObject
<
Grape
::
Entity
class
TreeObject
<
Grape
::
Entity
...
...
spec/fixtures/api/schemas/public_api/v4/branch.json
View file @
0f7b3d13
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
"commit"
,
"commit"
,
"merged"
,
"merged"
,
"protected"
,
"protected"
,
"default"
,
"developers_can_push"
,
"developers_can_push"
,
"developers_can_merge"
"developers_can_merge"
],
],
...
@@ -13,6 +14,7 @@
...
@@ -13,6 +14,7 @@
"commit"
:
{
"$ref"
:
"commit/basic.json"
},
"commit"
:
{
"$ref"
:
"commit/basic.json"
},
"merged"
:
{
"type"
:
"boolean"
},
"merged"
:
{
"type"
:
"boolean"
},
"protected"
:
{
"type"
:
"boolean"
},
"protected"
:
{
"type"
:
"boolean"
},
"default"
:
{
"type"
:
"boolean"
},
"developers_can_push"
:
{
"type"
:
"boolean"
},
"developers_can_push"
:
{
"type"
:
"boolean"
},
"developers_can_merge"
:
{
"type"
:
"boolean"
},
"developers_can_merge"
:
{
"type"
:
"boolean"
},
"can_push"
:
{
"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