Commit 815e678c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Revert "Use rugged in web editor for base64 encoding"

This reverts commit 54113319.
parent 34975f01
...@@ -33,20 +33,23 @@ module Files ...@@ -33,20 +33,23 @@ module Files
end end
end end
content = if params[:encoding] == 'base64'
if params[:encoding] == 'base64' new_file_action = Gitlab::Satellite::NewFileAction.new(current_user, project, ref, file_path)
Base64.decode64(params[:content]) created_successfully = new_file_action.commit!(
else params[:content],
params[:content] params[:commit_message],
end params[:encoding],
params[:new_branch]
created_successfully = repository.commit_file( )
current_user, else
file_path, created_successfully = repository.commit_file(
content, current_user,
params[:commit_message], file_path,
params[:new_branch] || ref params[:content],
) params[:commit_message],
params[:new_branch] || ref
)
end
if created_successfully if created_successfully
......
...@@ -19,20 +19,23 @@ module Files ...@@ -19,20 +19,23 @@ module Files
return error("You can only edit text files") return error("You can only edit text files")
end end
content = if params[:encoding] == 'base64'
if params[:encoding] == 'base64' edit_file_action = Gitlab::Satellite::EditFileAction.new(current_user, project, ref, path)
Base64.decode64(params[:content]) edit_file_action.commit!(
else params[:content],
params[:content] params[:commit_message],
end params[:encoding],
params[:new_branch]
repository.commit_file( )
current_user, else
path, repository.commit_file(
content, current_user,
params[:commit_message], path,
params[:new_branch] || ref params[:content],
) params[:commit_message],
params[:new_branch] || ref
)
end
success success
rescue Gitlab::Satellite::CheckoutFailed => ex rescue Gitlab::Satellite::CheckoutFailed => ex
......
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