mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 21:26:07 +10:00
Revert "Use rugged in web editor for base64 encoding"
This reverts commit 541133197b.
This commit is contained in:
@@ -33,20 +33,23 @@ module Files
|
||||
end
|
||||
end
|
||||
|
||||
content =
|
||||
if params[:encoding] == 'base64'
|
||||
Base64.decode64(params[:content])
|
||||
else
|
||||
params[:content]
|
||||
end
|
||||
|
||||
created_successfully = repository.commit_file(
|
||||
current_user,
|
||||
file_path,
|
||||
content,
|
||||
params[:commit_message],
|
||||
params[:new_branch] || ref
|
||||
)
|
||||
if params[:encoding] == 'base64'
|
||||
new_file_action = Gitlab::Satellite::NewFileAction.new(current_user, project, ref, file_path)
|
||||
created_successfully = new_file_action.commit!(
|
||||
params[:content],
|
||||
params[:commit_message],
|
||||
params[:encoding],
|
||||
params[:new_branch]
|
||||
)
|
||||
else
|
||||
created_successfully = repository.commit_file(
|
||||
current_user,
|
||||
file_path,
|
||||
params[:content],
|
||||
params[:commit_message],
|
||||
params[:new_branch] || ref
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
if created_successfully
|
||||
|
||||
@@ -19,20 +19,23 @@ module Files
|
||||
return error("You can only edit text files")
|
||||
end
|
||||
|
||||
content =
|
||||
if params[:encoding] == 'base64'
|
||||
Base64.decode64(params[:content])
|
||||
else
|
||||
params[:content]
|
||||
end
|
||||
|
||||
repository.commit_file(
|
||||
current_user,
|
||||
path,
|
||||
content,
|
||||
params[:commit_message],
|
||||
params[:new_branch] || ref
|
||||
)
|
||||
if params[:encoding] == 'base64'
|
||||
edit_file_action = Gitlab::Satellite::EditFileAction.new(current_user, project, ref, path)
|
||||
edit_file_action.commit!(
|
||||
params[:content],
|
||||
params[:commit_message],
|
||||
params[:encoding],
|
||||
params[:new_branch]
|
||||
)
|
||||
else
|
||||
repository.commit_file(
|
||||
current_user,
|
||||
path,
|
||||
params[:content],
|
||||
params[:commit_message],
|
||||
params[:new_branch] || ref
|
||||
)
|
||||
end
|
||||
|
||||
success
|
||||
rescue Gitlab::Satellite::CheckoutFailed => ex
|
||||
|
||||
Reference in New Issue
Block a user