Commit 08c15116 authored by tiagonbotelho's avatar tiagonbotelho

creates the update_file method in repository.rb and applies changes accordingly

parent 3824e8e1
...@@ -8,7 +8,8 @@ module CreatesCommit ...@@ -8,7 +8,8 @@ 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: @path,
previous_path: @previous_path
) )
puts "#" * 10 puts "#" * 10
......
...@@ -749,15 +749,31 @@ class Repository ...@@ -749,15 +749,31 @@ class Repository
options[:author] = committer options[:author] = committer
options[:commit] = { options[:commit] = {
message: message, message: message,
<<<<<<< 3824e8e1c4315bb3d1b2c1389f442d3b5e94f945
branch: ref branch: ref
} }
=======
branch: ref,
}
if previous_path
options[:file] = {
path: previous_path
}
Gitlab::Git::Blob.remove(raw_repository, options)
end
>>>>>>> creates the update_file method in repository.rb and applies changes accordingly
options[:file] = { options[:file] = {
content: content, content: content,
path: path, path: path,
update: update update: update
} }
<<<<<<< 3824e8e1c4315bb3d1b2c1389f442d3b5e94f945
if previous_path if previous_path
options[:file].merge!(previous_path: previous_path) options[:file].merge!(previous_path: previous_path)
......
...@@ -9,6 +9,7 @@ module Files ...@@ -9,6 +9,7 @@ module Files
@commit_message = params[:commit_message] @commit_message = params[:commit_message]
@file_path = params[:file_path] @file_path = params[:file_path]
@previous_path = params[:previous_path]
@file_content = if params[:file_content_encoding] == 'base64' @file_content = if params[:file_content_encoding] == 'base64'
Base64.decode64(params[:file_content]) Base64.decode64(params[:file_content])
else else
......
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