Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Padovani <riccardo@rpadovani.com>2018-08-18 14:00:40 +0300
committerRiccardo Padovani <riccardo@rpadovani.com>2018-08-18 14:03:42 +0300
commit25efc5f288455d4c0920ea5e4dc82e9d845bcb06 (patch)
tree6c357f169f40bf436c74406deaae81ea682a2188 /lib/api/entities.rb
parent197a305b845246c5a39266a64c167169f09ac787 (diff)
Add default parameter to branches API
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 27f28e1df93..3ec63fa7573 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -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