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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7001ad2d
Commit
7001ad2d
authored
Jan 16, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add files encoding support on context level
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
1d497a12
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
app/contexts/files/create_context.rb
app/contexts/files/create_context.rb
+2
-1
app/contexts/files/update_context.rb
app/contexts/files/update_context.rb
+4
-3
No files found.
app/contexts/files/create_context.rb
View file @
7001ad2d
...
...
@@ -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
...
...
app/contexts/files/update_context.rb
View file @
7001ad2d
...
...
@@ -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
...
...
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