summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorMatt Humphrey <matt@tomatto.co.uk>2013-01-28 17:22:44 +0000
committerMatt Humphrey <matt@tomatto.co.uk>2013-01-31 09:26:03 +0000
commit2c7554e897356fe424f292c66cd03e0192b05167 (patch)
tree486591bc4278aecd394eb85494cf734405ba2921 /lib/api/entities.rb
parentdf6db81e2ab36410c377f8a9a712756653de0e2a (diff)
downloadgitlab-ce-2c7554e897356fe424f292c66cd03e0192b05167.tar.gz
Added methods to protect and unprotect branches
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 80e2954a344..3f228300e26 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -33,6 +33,11 @@ module Gitlab
class RepoObject < Grape::Entity
expose :name, :commit
+ expose :protected do |repo, options|
+ if options[:project]
+ options[:project].protected_branch? repo.name
+ end
+ end
end
class RepoCommit < Grape::Entity