Commit 7001ad2dda56343dcdf035aebdf3334068d123a0

Authored by Dmitriy Zaporozhets
1 parent 1d497a12

Add files encoding support on context level

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/contexts/files/create_context.rb
@@ -33,7 +33,8 @@ module Files @@ -33,7 +33,8 @@ module Files
33 new_file_action = Gitlab::Satellite::NewFileAction.new(current_user, project, ref, file_path) 33 new_file_action = Gitlab::Satellite::NewFileAction.new(current_user, project, ref, file_path)
34 created_successfully = new_file_action.commit!( 34 created_successfully = new_file_action.commit!(
35 params[:content], 35 params[:content],
36 - params[:commit_message] 36 + params[:commit_message],
  37 + params[:encoding]
37 ) 38 )
38 39
39 if created_successfully 40 if created_successfully
app/contexts/files/update_context.rb
@@ -23,10 +23,11 @@ module Files @@ -23,10 +23,11 @@ module Files
23 return error("You can only edit text files") 23 return error("You can only edit text files")
24 end 24 end
25 25
26 - new_file_action = Gitlab::Satellite::EditFileAction.new(current_user, project, ref, path)  
27 - created_successfully = new_file_action.commit!( 26 + edit_file_action = Gitlab::Satellite::EditFileAction.new(current_user, project, ref, path)
  27 + created_successfully = edit_file_action.commit!(
28 params[:content], 28 params[:content],
29 - params[:commit_message] 29 + params[:commit_message],
  30 + params[:encooding]
30 ) 31 )
31 32
32 if created_successfully 33 if created_successfully