diff options
Diffstat (limited to 'app/controllers/projects')
| -rw-r--r-- | app/controllers/projects/edit_tree_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/projects/edit_tree_controller.rb b/app/controllers/projects/edit_tree_controller.rb index 5d05c585ecc..0e51ff59f39 100644 --- a/app/controllers/projects/edit_tree_controller.rb +++ b/app/controllers/projects/edit_tree_controller.rb @@ -45,5 +45,9 @@ class Projects::EditTreeController < Projects::ApplicationController end return access_denied! unless allowed + + unless @repository.branch_names.include?(@ref) + redirect_to project_blob_path(@project, @id), notice: "You can only edit this file if you are on top of a branch" + end end end |
