提交 2298c003 编写于 作者: T tiagonbotelho

changes the usasge of path to file_path on blob_controller for compatibillity...

changes the usasge of path to file_path on blob_controller for compatibillity with the create action
上级 5d6b90a0
......@@ -8,7 +8,7 @@ module CreatesCommit
source_project: @project,
source_branch: @ref,
target_branch: @target_branch,
file_path: @path,
file_path: @file_path,
previous_path: @previous_path
)
......
......@@ -39,16 +39,16 @@ class Projects::BlobController < Projects::ApplicationController
def update
unless params[:file_name].empty?
@previous_path = @path
@path = params[:file_name]
@previous_path = @file_path
@file_path = params[:file_name]
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(@path)}"
"#file-path-#{hexdigest(@file_path)}"
else
namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @path))
namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @file_path))
end
create_commit(Files::UpdateService, success_path: after_edit_path,
......
......@@ -5,7 +5,7 @@
= ref
%span.editor-file-name
- if current_action?(:edit) || current_action?(:update)
= text_field_tag 'file_name', (params[:file_name] || @path),
= text_field_tag 'file_name', (params[:file_name] || @file_path),
class: 'form-control new-file-name'
- if current_action?(:new) || current_action?(:create)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册