diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2014-12-26 11:39:12 +0100 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2014-12-26 11:39:12 +0100 |
commit | 92eb3974ac28aff7c78f4ca0cbafbad842fc7160 (patch) | |
tree | daa081e7ef8cd4d1527000dbc5a7aca5caefe9af /lib/gitlab/git_access.rb | |
parent | 770b2a5cfbec1081756bfa2d8bf046b7b16bb638 (diff) | |
download | gitlab-ce-92eb3974ac28aff7c78f4ca0cbafbad842fc7160.tar.gz |
Add option to disable/enable developers push to already protected branches.
Diffstat (limited to 'lib/gitlab/git_access.rb')
-rw-r--r-- | lib/gitlab/git_access.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index d66dcad88bd..d47ef61fd11 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -80,7 +80,7 @@ module Gitlab action = if project.protected_branch?(branch_name(ref)) protected_branch_action(project, oldrev, newrev, branch_name(ref)) - elsif protected_tag?(tag_name(ref)) + elsif protected_tag?(project, tag_name(ref)) # Prevent any changes to existing git tag unless user has permissions :admin_project else @@ -114,7 +114,7 @@ module Gitlab end end - def protected_tag?(tag_name) + def protected_tag?(project, tag_name) project.repository.tag_names.include?(tag_name) end |