diff options
author | Robert Speicher <robert@gitlab.com> | 2018-09-01 03:39:43 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-09-01 03:39:43 +0300 |
commit | 21b7e203b3d0b3048cd5f860e602d8a18655f118 (patch) | |
tree | 508e57775ff761599b25ca499daa15551e33c85e /lib | |
parent | f9b96bd273c636c41e0160b97ea9182f97339f26 (diff) | |
parent | 5e5a16a5a8777f6de466f1e790a53a8a1c5b53d7 (diff) |
Merge branch 'feature/#32877-add-default-field-branch-api' into 'master'
Add default parameter to branches API
Closes #32877
See merge request gitlab-org/gitlab-ce!21294
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 95b25d7351a..59042d2b568 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -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 |