summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-04 17:18:49 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-04 17:18:49 +0300
commitb99f357e96f683643b1e739b12a1ba972303d0aa (patch)
tree107180cf5bc10399b04dda277e926a3a47d32f6a
parent65197b8a8a74f662313ac0885aced49b9d243e9d (diff)
downloadgitlab-ce-b99f357e96f683643b1e739b12a1ba972303d0aa.tar.gz
Dont allow file edit for non-branches ref
-rw-r--r--app/helpers/tree_helper.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index a77db475234..73d36d0801c 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -57,6 +57,8 @@ module TreeHelper
end
def allowed_tree_edit?
+ return false unless @repository.branch_names.include?(@ref)
+
if @project.protected_branch? @ref
can?(current_user, :push_code_to_protected_branches, @project)
else