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
5f166878
Commit
5f166878
authored
Oct 26, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update arguments for Gitlab::Satellite::EditFileAction#initialize
parent
55779b00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
app/controllers/tree_controller.rb
app/controllers/tree_controller.rb
+1
-2
lib/gitlab/satellite/edit_file_action.rb
lib/gitlab/satellite/edit_file_action.rb
+6
-5
No files found.
app/controllers/tree_controller.rb
View file @
5f166878
...
...
@@ -26,9 +26,8 @@ class TreeController < ProjectResourceController
end
def
update
file_editor
=
Gitlab
::
Satellite
::
EditFileAction
.
new
(
current_user
,
@project
,
@ref
)
file_editor
=
Gitlab
::
Satellite
::
EditFileAction
.
new
(
current_user
,
@project
,
@ref
,
@path
)
update_status
=
file_editor
.
update
(
@path
,
params
[
:content
],
params
[
:commit_message
],
params
[
:last_commit
]
...
...
lib/gitlab/satellite/edit_file_action.rb
View file @
5f166878
...
...
@@ -5,15 +5,16 @@ module Gitlab
# It gives you ability to make changes to files
# & commit this changes from GitLab UI.
class
EditFileAction
<
Action
attr_accessor
:ref
attr_accessor
:
path
,
:
ref
def
initialize
(
user
,
project
,
ref
)
def
initialize
(
user
,
project
,
ref
,
path
)
super
user
,
project
@path
=
path
@ref
=
ref
end
def
update
(
path
,
content
,
commit_message
,
last_commit
)
return
false
unless
can_edit?
(
path
,
last_commit
)
def
update
(
content
,
commit_message
,
last_commit
)
return
false
unless
can_edit?
(
last_commit
)
in_locked_and_timed_satellite
do
|
repo
|
prepare_satellite!
(
repo
)
...
...
@@ -34,7 +35,7 @@ module Gitlab
protected
def
can_edit?
(
path
,
last_commit
)
def
can_edit?
(
last_commit
)
current_last_commit
=
@project
.
last_commit_for
(
ref
,
path
).
sha
last_commit
==
current_last_commit
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