From 25efc5f288455d4c0920ea5e4dc82e9d845bcb06 Mon Sep 17 00:00:00 2001 From: Riccardo Padovani Date: Sat, 18 Aug 2018 13:00:40 +0200 Subject: Add default parameter to branches API --- lib/api/entities.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3