diff options
author | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-07-12 11:49:21 +0100 |
---|---|---|
committer | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-07-12 15:55:16 +0100 |
commit | 893f3f28562c45da796ac5674600fd368bb3dbdf (patch) | |
tree | 279bd099459c7cfaab62fd8ed70760f41e14efb2 /app/controllers/projects/blob_controller.rb | |
parent | cf96c7596a80296abffe8ad75303cc964d72ee5d (diff) | |
download | gitlab-ce-893f3f28562c45da796ac5674600fd368bb3dbdf.tar.gz |
refactors update action to change commit_params with the correct path
Diffstat (limited to 'app/controllers/projects/blob_controller.rb')
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index fb6ddd0e51d..ac1141b8613 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -39,16 +39,17 @@ class Projects::BlobController < Projects::ApplicationController def update unless params[:file_name].empty? - @previous_path = @file_path - @file_path = params[:file_name] + @previous_path = @path + @path = params[:file_name] + @commit_params[:file_path] = @path end after_edit_path = if from_merge_request && @target_branch == @ref diffs_namespace_project_merge_request_path(from_merge_request.target_project.namespace, from_merge_request.target_project, from_merge_request) + - "#file-path-#{hexdigest(@file_path)}" + "#file-path-#{hexdigest(@path)}" else - namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @file_path)) + namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @path)) end create_commit(Files::UpdateService, success_path: after_edit_path, |