OSDN Git Service

Dont allow file edit for non-branches ref
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Sun, 4 Aug 2013 14:18:49 +0000 (17:18 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Sun, 4 Aug 2013 14:18:49 +0000 (17:18 +0300)
app/helpers/tree_helper.rb

index a77db47..73d36d0 100644 (file)
@@ -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