summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-31 10:44:20 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-31 10:44:20 -0800
commit5857a7a9ce6f9bd37b633d48074778bcbde880a4 (patch)
tree10bc126e3da80bbd4133a51e36636186655101cf /lib/api/entities.rb
parentdfe2a742c2f2b862109a757cf90495ea1fcde70c (diff)
parent2c7554e897356fe424f292c66cd03e0192b05167 (diff)
downloadgitlab-ce-5857a7a9ce6f9bd37b633d48074778bcbde880a4.tar.gz
Merge pull request #2839 from m4tthumphrey/protected-branches-api
Added methods to protect and unprotect branches in from the API
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 da51bc6ecd6..5cbb1118a89 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -34,6 +34,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