OSDN Git Service

Add files encoding support on context level
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 16 Jan 2014 16:10:35 +0000 (18:10 +0200)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 16 Jan 2014 16:10:35 +0000 (18:10 +0200)
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/contexts/files/create_context.rb
app/contexts/files/update_context.rb

index b3d62a0..3b684d3 100644 (file)
@@ -33,7 +33,8 @@ module Files
       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[:commit_message],
+        params[:encoding]
       )
 
       if created_successfully
index 556027a..2458efa 100644 (file)
@@ -23,10 +23,11 @@ module Files
         return error("You can only edit text files")
       end
 
-      new_file_action = Gitlab::Satellite::EditFileAction.new(current_user, project, ref, path)
-      created_successfully = new_file_action.commit!(
+      edit_file_action = Gitlab::Satellite::EditFileAction.new(current_user, project, ref, path)
+      created_successfully = edit_file_action.commit!(
         params[:content],
-        params[:commit_message]
+        params[:commit_message],
+        params[:encooding]
       )
 
       if created_successfully