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
8778961d
Commit
8778961d
authored
Oct 26, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move prepare_satellite! to Gitlab::Satelite::Action
parent
78235edd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
lib/gitlab/satellite/action.rb
lib/gitlab/satellite/action.rb
+18
-2
lib/gitlab/satellite/merge_action.rb
lib/gitlab/satellite/merge_action.rb
+2
-16
No files found.
lib/gitlab/satellite/action.rb
View file @
8778961d
...
@@ -3,10 +3,11 @@ module Gitlab
...
@@ -3,10 +3,11 @@ module Gitlab
class
Action
class
Action
DEFAULT_OPTIONS
=
{
git_timeout:
30
.
seconds
}
DEFAULT_OPTIONS
=
{
git_timeout:
30
.
seconds
}
attr_accessor
:options
,
:project
attr_accessor
:options
,
:project
,
:user
def
initialize
(
project
,
options
=
{})
def
initialize
(
project
,
user
,
options
=
{})
@project
=
project
@project
=
project
@user
=
user
@options
=
DEFAULT_OPTIONS
.
merge
(
options
)
@options
=
DEFAULT_OPTIONS
.
merge
(
options
)
end
end
...
@@ -42,6 +43,21 @@ module Gitlab
...
@@ -42,6 +43,21 @@ module Gitlab
def
lock_file
def
lock_file
Rails
.
root
.
join
(
"tmp"
,
"
#{
project
.
path
}
.lock"
)
Rails
.
root
.
join
(
"tmp"
,
"
#{
project
.
path
}
.lock"
)
end
end
# * Clears the satellite
# * Updates the satellite from Gitolite
# * Sets up Git variables for the user
#
# Note: use this within #in_locked_and_timed_satellite
def
prepare_satellite!
(
repo
)
project
.
satellite
.
clear
repo
.
git
.
reset
(
hard:
true
)
repo
.
git
.
fetch
({},
:origin
)
repo
.
git
.
config
({},
"user.name"
,
user
.
name
)
repo
.
git
.
config
({},
"user.email"
,
user
.
email
)
end
end
end
end
end
end
end
lib/gitlab/satellite/merge_action.rb
View file @
8778961d
module
Gitlab
module
Gitlab
module
Satellite
module
Satellite
class
MergeAction
<
Action
class
MergeAction
<
Action
attr_accessor
:merge_request
,
:user
attr_accessor
:merge_request
def
initialize
(
merge_request
,
user
)
def
initialize
(
merge_request
,
user
)
super
merge_request
.
project
super
merge_request
.
project
,
user
@merge_request
=
merge_request
@merge_request
=
merge_request
@user
=
user
end
end
def
can_be_merged?
def
can_be_merged?
...
@@ -65,19 +64,6 @@ module Gitlab
...
@@ -65,19 +64,6 @@ module Gitlab
Gitlab
::
GitLogger
.
error
(
ex
.
message
)
Gitlab
::
GitLogger
.
error
(
ex
.
message
)
false
false
end
end
# * Clears the satellite
# * Updates the satellite from Gitolite
# * Sets up Git variables for the user
def
prepare_satellite!
(
repo
)
project
.
satellite
.
clear
repo
.
git
.
reset
(
hard:
true
)
repo
.
git
.
fetch
({},
:origin
)
repo
.
git
.
config
({},
"user.name"
,
user
.
name
)
repo
.
git
.
config
({},
"user.email"
,
user
.
email
)
end
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