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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
3ffd6388
Commit
3ffd6388
authored
Aug 11, 2015
by
Dmitriy Zaporozhets
Committed by
Valery Sizov
Aug 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Use rugged in web editor for base64 encoding"
This reverts commit
54113319
.
parent
f22f7a6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
28 deletions
+34
-28
app/services/files/create_service.rb
app/services/files/create_service.rb
+17
-14
app/services/files/update_service.rb
app/services/files/update_service.rb
+17
-14
No files found.
app/services/files/create_service.rb
View file @
3ffd6388
...
@@ -33,20 +33,23 @@ module Files
...
@@ -33,20 +33,23 @@ module Files
end
end
end
end
content
=
if
params
[
:encoding
]
==
'base64'
if
params
[
:encoding
]
==
'base64'
new_file_action
=
Gitlab
::
Satellite
::
NewFileAction
.
new
(
current_user
,
project
,
ref
,
file_path
)
Base64
.
decode64
(
params
[
:content
])
created_successfully
=
new_file_action
.
commit!
(
else
params
[
:content
],
params
[
:content
]
params
[
:commit_message
],
end
params
[
:encoding
],
params
[
:new_branch
]
created_successfully
=
repository
.
commit_file
(
)
current_user
,
else
file_path
,
created_successfully
=
repository
.
commit_file
(
content
,
current_user
,
params
[
:commit_message
],
file_path
,
params
[
:new_branch
]
||
ref
params
[
:content
],
)
params
[
:commit_message
],
params
[
:new_branch
]
||
ref
)
end
if
created_successfully
if
created_successfully
...
...
app/services/files/update_service.rb
View file @
3ffd6388
...
@@ -19,20 +19,23 @@ module Files
...
@@ -19,20 +19,23 @@ module Files
return
error
(
"You can only edit text files"
)
return
error
(
"You can only edit text files"
)
end
end
content
=
if
params
[
:encoding
]
==
'base64'
if
params
[
:encoding
]
==
'base64'
edit_file_action
=
Gitlab
::
Satellite
::
EditFileAction
.
new
(
current_user
,
project
,
ref
,
path
)
Base64
.
decode64
(
params
[
:content
])
edit_file_action
.
commit!
(
else
params
[
:content
],
params
[
:content
]
params
[
:commit_message
],
end
params
[
:encoding
],
params
[
:new_branch
]
repository
.
commit_file
(
)
current_user
,
else
path
,
repository
.
commit_file
(
content
,
current_user
,
params
[
:commit_message
],
path
,
params
[
:new_branch
]
||
ref
params
[
:content
],
)
params
[
:commit_message
],
params
[
:new_branch
]
||
ref
)
end
success
success
rescue
Gitlab
::
Satellite
::
CheckoutFailed
=>
ex
rescue
Gitlab
::
Satellite
::
CheckoutFailed
=>
ex
...
...
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