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
iv
gitlab-ce
Commits
e7832d01
Commit
e7832d01
authored
Jul 06, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactors to pass values as arguments through options
parent
2313b09b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
25 deletions
+8
-25
app/models/repository.rb
app/models/repository.rb
+8
-25
No files found.
app/models/repository.rb
View file @
e7832d01
...
...
@@ -734,42 +734,25 @@ class Repository
def
update_file
(
user
,
path
,
content
,
branch
:,
previous_path
:,
message
:)
commit_with_hooks
(
user
,
branch
)
do
|
ref
|
committer
=
user_to_committer
(
user
)
options
=
{}
options
[
:committer
]
=
committer
options
[
:author
]
=
committer
options
[
:commit
]
=
{
message:
message
,
<<<<<<<
3824e8
e1c4315bb3d1b2c1389f442d3b5e94f945
commit_options
=
{}
commit_options
[
:committer
]
=
committer
commit_options
[
:author
]
=
committer
commit_options
[
:commit
]
=
{
message:
options
[
:message
],
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
]
=
{
commit_options
[
:file
]
=
{
content:
content
,
path:
path
,
update:
true
}
<<<<<<<
3824e8
e1c4315bb3d1b2c1389f442d3b5e94f945
if
previous_path
options
[
:file
][
:previous_path
]
=
previous_path
Gitlab
::
Git
::
Blob
.
rename
(
raw_repository
,
options
)
Gitlab
::
Git
::
Blob
.
rename
(
raw_repository
,
commit_options
)
else
Gitlab
::
Git
::
Blob
.
commit
(
raw_repository
,
options
)
Gitlab
::
Git
::
Blob
.
commit
(
raw_repository
,
commit_
options
)
end
end
end
...
...
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