summaryrefslogtreecommitdiff
path: root/lib/api/commit_statuses.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-04 12:13:11 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-09-04 12:13:11 +0200
commite23e86953de26b1681cbde5b3847e631e5ae7c74 (patch)
treec3067628d883780839f4c294b2156b66885a32b3 /lib/api/commit_statuses.rb
parent339a1ad011f87fa969fd5ba644c504518924771a (diff)
parentebbbc7ef52fbd1d3339e2e21be967d313a074a28 (diff)
downloadgitlab-ce-e23e86953de26b1681cbde5b3847e631e5ae7c74.tar.gz
Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (469 commits)
Diffstat (limited to 'lib/api/commit_statuses.rb')
-rw-r--r--lib/api/commit_statuses.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb
index 485b680cd5f..6314ea63197 100644
--- a/lib/api/commit_statuses.rb
+++ b/lib/api/commit_statuses.rb
@@ -5,7 +5,7 @@ module API
params do
requires :id, type: String, desc: 'The ID of a project'
end
- resource :projects, requirements: { id: %r{[^/]+} } do
+ resource :projects, requirements: API::PROJECT_ENDPOINT_REQUIREMENTS do
include PaginationParams
before { authenticate! }
@@ -74,7 +74,8 @@ module API
source: :external,
sha: commit.sha,
ref: ref,
- user: current_user)
+ user: current_user,
+ protected: @project.protected_for?(ref))
end
status = GenericCommitStatus.running_or_pending.find_or_initialize_by(
@@ -82,7 +83,8 @@ module API
pipeline: pipeline,
name: name,
ref: ref,
- user: current_user
+ user: current_user,
+ protected: @project.protected_for?(ref)
)
optional_attributes =