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
Boxiang Sun
gitlab-ce
Commits
08c15116
Commit
08c15116
authored
Jul 04, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
creates the update_file method in repository.rb and applies changes accordingly
parent
3824e8e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
app/controllers/concerns/creates_commit.rb
app/controllers/concerns/creates_commit.rb
+2
-1
app/models/repository.rb
app/models/repository.rb
+16
-0
app/services/files/base_service.rb
app/services/files/base_service.rb
+1
-0
No files found.
app/controllers/concerns/creates_commit.rb
View file @
08c15116
...
...
@@ -8,7 +8,8 @@ module CreatesCommit
source_project:
@project
,
source_branch:
@ref
,
target_branch:
@target_branch
,
file_path:
@path
file_path:
@path
,
previous_path:
@previous_path
)
puts
"#"
*
10
...
...
app/models/repository.rb
View file @
08c15116
...
...
@@ -749,15 +749,31 @@ class Repository
options
[
:author
]
=
committer
options
[
:commit
]
=
{
message:
message
,
<<<<<<<
3824e8
e1c4315bb3d1b2c1389f442d3b5e94f945
branch:
ref
}
=======
branch:
ref
,
}
if
previous_path
options
[
:file
]
=
{
path:
previous_path
}
Gitlab
::
Git
::
Blob
.
remove
(
raw_repository
,
options
)
end
>>>>>>>
creates
the
update_file
method
in
repository
.
rb
and
applies
changes
accordingly
options
[
:file
]
=
{
content:
content
,
path:
path
,
update:
update
}
<<<<<<<
3824e8
e1c4315bb3d1b2c1389f442d3b5e94f945
if
previous_path
options
[
:file
].
merge!
(
previous_path:
previous_path
)
...
...
app/services/files/base_service.rb
View file @
08c15116
...
...
@@ -9,6 +9,7 @@ module Files
@commit_message
=
params
[
:commit_message
]
@file_path
=
params
[
:file_path
]
@previous_path
=
params
[
:previous_path
]
@file_content
=
if
params
[
:file_content_encoding
]
==
'base64'
Base64
.
decode64
(
params
[
:file_content
])
else
...
...
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