diff options
Diffstat (limited to 'app/controllers/tree_controller.rb')
-rw-r--r-- | app/controllers/tree_controller.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/tree_controller.rb b/app/controllers/tree_controller.rb index 0a67e033b83..08fd8986f8d 100644 --- a/app/controllers/tree_controller.rb +++ b/app/controllers/tree_controller.rb @@ -25,9 +25,8 @@ class TreeController < ProjectResourceController end def update - last_commit = @project.commits(@ref, @path, 1).first.sha - file_editor = Gitlab::FileEditor.new(current_user, @project) - if file_editor.can_edit?(@path, last_commit) + file_editor = Gitlab::FileEditor.new(current_user, @project, @ref) + if file_editor.can_edit?(@path, params[:last_commit]) file_editor.update(@path, params[:content]) redirect_to project_tree_path(@project, @id), :notice => "File has been successfully changed" else |