Skip to content
Snippets Groups Projects
Commit f4b38792 authored by tiagonbotelho's avatar tiagonbotelho
Browse files

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

parent 3bda9621
No related branches found
No related tags found
No related merge requests found
Loading
@@ -7,7 +7,8 @@ module CreatesCommit
Loading
@@ -7,7 +7,8 @@ module CreatesCommit
commit_params = @commit_params.merge( commit_params = @commit_params.merge(
source_project: @project, source_project: @project,
source_branch: @ref, 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 result = service.new(@tree_edit_project, current_user, commit_params).execute
Loading
Loading
Loading
@@ -44,7 +44,11 @@ class Projects::BlobController < Projects::ApplicationController
Loading
@@ -44,7 +44,11 @@ class Projects::BlobController < Projects::ApplicationController
"#file-path-#{hexdigest(@path)}" "#file-path-#{hexdigest(@path)}"
else else
# params[:file_name] stores the new name for the file # 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 end
   
create_commit(Files::UpdateService, success_path: after_edit_path, create_commit(Files::UpdateService, success_path: after_edit_path,
Loading
Loading
Loading
@@ -15,6 +15,8 @@ module Files
Loading
@@ -15,6 +15,8 @@ module Files
params[:file_content] params[:file_content]
end end
   
puts @file_path
# Validate parameters # Validate parameters
validate validate
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment