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
25efc5f2
Commit
25efc5f2
authored
Aug 18, 2018
by
Riccardo Padovani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default parameter to branches API
parent
197a305b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-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
No files found.
changelogs/unreleased/feature--32877-add-default-field-branch-api.yml
0 → 100644
View file @
25efc5f2
---
title
:
Add default parameter to branches API
merge_request
:
21294
author
:
Riccardo Padovani
type
:
changed
doc/api/branches.md
View file @
25efc5f2
...
...
@@ -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 @
25efc5f2
...
...
@@ -369,6 +369,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
...
...
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