Commit cf96c759 authored by tiagonbotelho's avatar 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
parent e167c941
...@@ -8,7 +8,7 @@ module CreatesCommit ...@@ -8,7 +8,7 @@ module CreatesCommit
source_project: @project, source_project: @project,
source_branch: @ref, source_branch: @ref,
target_branch: @target_branch, target_branch: @target_branch,
file_path: @path, file_path: @file_path,
previous_path: @previous_path previous_path: @previous_path
) )
......
...@@ -39,16 +39,16 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -39,16 +39,16 @@ class Projects::BlobController < Projects::ApplicationController
def update def update
unless params[:file_name].empty? unless params[:file_name].empty?
@previous_path = @path @previous_path = @file_path
@path = params[:file_name] @file_path = params[:file_name]
end end
after_edit_path = after_edit_path =
if from_merge_request && @target_branch == @ref 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) + 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 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 end
create_commit(Files::UpdateService, success_path: after_edit_path, create_commit(Files::UpdateService, success_path: after_edit_path,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
= ref = ref
%span.editor-file-name %span.editor-file-name
- if current_action?(:edit) || current_action?(:update) - 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' class: 'form-control new-file-name'
- if current_action?(:new) || current_action?(:create) - if current_action?(:new) || current_action?(:create)
%span.editor-file-name %span.editor-file-name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment