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
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
...
@@ -734,42 +734,25 @@ class Repository
def
update_file
(
user
,
path
,
content
,
branch
:,
previous_path
:,
message
:)
def
update_file
(
user
,
path
,
content
,
branch
:,
previous_path
:,
message
:)
commit_with_hooks
(
user
,
branch
)
do
|
ref
|
commit_with_hooks
(
user
,
branch
)
do
|
ref
|
committer
=
user_to_committer
(
user
)
committer
=
user_to_committer
(
user
)
options
=
{}
commit_options
=
{}
options
[
:committer
]
=
committer
commit_options
[
:committer
]
=
committer
options
[
:author
]
=
committer
commit_options
[
:author
]
=
committer
options
[
:commit
]
=
{
commit_options
[
:commit
]
=
{
message:
message
,
message:
options
[
:message
],
<<<<<<<
3824e8
e1c4315bb3d1b2c1389f442d3b5e94f945
branch:
ref
branch:
ref
}
}
=======
commit_options
[
:file
]
=
{
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
,
content:
content
,
path:
path
,
path:
path
,
update:
true
update:
true
}
}
<<<<<<<
3824e8
e1c4315bb3d1b2c1389f442d3b5e94f945
if
previous_path
if
previous_path
options
[
:file
][
:previous_path
]
=
previous_path
options
[
:file
][
:previous_path
]
=
previous_path
Gitlab
::
Git
::
Blob
.
rename
(
raw_repository
,
commit_options
)
Gitlab
::
Git
::
Blob
.
rename
(
raw_repository
,
options
)
else
else
Gitlab
::
Git
::
Blob
.
commit
(
raw_repository
,
options
)
Gitlab
::
Git
::
Blob
.
commit
(
raw_repository
,
commit_
options
)
end
end
end
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