Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
4f2e9fb8
Commit
4f2e9fb8
authored
Jan 16, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept encoding attribute in files API
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
7001ad2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lib/api/files.rb
lib/api/files.rb
+2
-2
No files found.
lib/api/files.rb
View file @
4f2e9fb8
...
@@ -18,7 +18,7 @@ module API
...
@@ -18,7 +18,7 @@ module API
#
#
post
":id/repository/files"
do
post
":id/repository/files"
do
required_attributes!
[
:file_path
,
:branch_name
,
:content
,
:commit_message
]
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
)
branch_name
=
attrs
.
delete
(
:branch_name
)
file_path
=
attrs
.
delete
(
:file_path
)
file_path
=
attrs
.
delete
(
:file_path
)
result
=
::
Files
::
CreateContext
.
new
(
user_project
,
current_user
,
attrs
,
branch_name
,
file_path
).
execute
result
=
::
Files
::
CreateContext
.
new
(
user_project
,
current_user
,
attrs
,
branch_name
,
file_path
).
execute
...
@@ -48,7 +48,7 @@ module API
...
@@ -48,7 +48,7 @@ module API
#
#
put
":id/repository/files"
do
put
":id/repository/files"
do
required_attributes!
[
:file_path
,
:branch_name
,
:content
,
:commit_message
]
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
)
branch_name
=
attrs
.
delete
(
:branch_name
)
file_path
=
attrs
.
delete
(
:file_path
)
file_path
=
attrs
.
delete
(
:file_path
)
result
=
::
Files
::
UpdateContext
.
new
(
user_project
,
current_user
,
attrs
,
branch_name
,
file_path
).
execute
result
=
::
Files
::
UpdateContext
.
new
(
user_project
,
current_user
,
attrs
,
branch_name
,
file_path
).
execute
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment