successfully adds the new version with the updated name on the projects repo

This commit is contained in:
tiagonbotelho 2016-07-01 17:46:37 +01:00
parent b34310ae9e
commit ac30c60ad9
2 changed files with 7 additions and 2 deletions

View file

@ -7,7 +7,8 @@ module CreatesCommit
commit_params = @commit_params.merge(
source_project: @project,
source_branch: @ref,
target_branch: @target_branch
target_branch: @target_branch,
file_path: @path
)
result = service.new(@tree_edit_project, current_user, commit_params).execute

View file

@ -44,7 +44,11 @@ class Projects::BlobController < Projects::ApplicationController
"#file-path-#{hexdigest(@path)}"
else
# params[:file_name] stores the new name for the file
namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, params[:file_name]))
unless params[:file_name] == @path
@path = params[:file_name]
end
namespace_project_blob_path(@project.namespace, @project, File.join(@target_branch, @path))
end
create_commit(Files::UpdateService, success_path: after_edit_path,