summaryrefslogtreecommitdiff
path: root/lib/api/files.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-16 18:11:00 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-16 18:11:00 +0200
commit4f2e9fb8e56249d3bcce128a50a6fa6b4deca00f (patch)
treec03a7d473c2677bf0a492f647589864f85d80e1e /lib/api/files.rb
parent7001ad2dda56343dcdf035aebdf3334068d123a0 (diff)
downloadgitlab-ce-4f2e9fb8e56249d3bcce128a50a6fa6b4deca00f.tar.gz
Accept encoding attribute in files API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/files.rb')
-rw-r--r--lib/api/files.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb
index 6a5419a580f..8e87ae52e64 100644
--- a/lib/api/files.rb
+++ b/lib/api/files.rb
@@ -18,7 +18,7 @@ module API
#
post ":id/repository/files" do
required_attributes! [:file_path, :branch_name, :content, :commit_message]
- attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message]
+ attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message, :encoding]
branch_name = attrs.delete(:branch_name)
file_path = attrs.delete(:file_path)
result = ::Files::CreateContext.new(user_project, current_user, attrs, branch_name, file_path).execute
@@ -48,7 +48,7 @@ module API
#
put ":id/repository/files" do
required_attributes! [:file_path, :branch_name, :content, :commit_message]
- attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message]
+ attrs = attributes_for_keys [:file_path, :branch_name, :content, :commit_message, :encoding]
branch_name = attrs.delete(:branch_name)
file_path = attrs.delete(:file_path)
result = ::Files::UpdateContext.new(user_project, current_user, attrs, branch_name, file_path).execute