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
Tatuya Kamada
gitlab-ce
Commits
d66d1097
Commit
d66d1097
authored
Mar 24, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6594 from tsigo/rs-small-changes
Small changes
parents
92c811e8
760f827b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
lib/gitlab/satellite/satellite.rb
lib/gitlab/satellite/satellite.rb
+8
-9
spec/support/test_env.rb
spec/support/test_env.rb
+1
-3
No files found.
lib/gitlab/satellite/satellite.rb
View file @
d66d1097
module
Gitlab
module
Gitlab
class
SatelliteNotExistError
<
StandardError
;
end
class
SatelliteNotExistError
<
StandardError
def
initialize
(
msg
=
"Satellite doesn't exist"
)
super
end
end
module
Satellite
module
Satellite
class
Satellite
class
Satellite
...
@@ -17,14 +21,9 @@ module Gitlab
...
@@ -17,14 +21,9 @@ module Gitlab
Gitlab
::
Satellite
::
Logger
.
error
(
message
)
Gitlab
::
Satellite
::
Logger
.
error
(
message
)
end
end
def
raise_no_satellite
raise
SatelliteNotExistError
.
new
(
"Satellite doesn't exist"
)
end
def
clear_and_update!
def
clear_and_update!
raise
_no_satellite
unless
exists?
raise
SatelliteNotExistError
unless
exists?
File
.
exists?
path
@repo
=
nil
@repo
=
nil
clear_working_dir!
clear_working_dir!
delete_heads!
delete_heads!
...
@@ -55,7 +54,7 @@ module Gitlab
...
@@ -55,7 +54,7 @@ module Gitlab
# * Changes the current directory to the satellite's working dir
# * Changes the current directory to the satellite's working dir
# * Yields
# * Yields
def
lock
def
lock
raise
_no_satellite
unless
exists?
raise
SatelliteNotExistError
unless
exists?
File
.
open
(
lock_file
,
"w+"
)
do
|
f
|
File
.
open
(
lock_file
,
"w+"
)
do
|
f
|
begin
begin
...
@@ -77,7 +76,7 @@ module Gitlab
...
@@ -77,7 +76,7 @@ module Gitlab
end
end
def
repo
def
repo
raise
_no_satellite
unless
exists?
raise
SatelliteNotExistError
unless
exists?
@repo
||=
Grit
::
Repo
.
new
(
path
)
@repo
||=
Grit
::
Repo
.
new
(
path
)
end
end
...
...
spec/support/test_env.rb
View file @
d66d1097
...
@@ -29,7 +29,6 @@ module TestEnv
...
@@ -29,7 +29,6 @@ module TestEnv
disable_mailer
if
opts
[
:mailer
]
==
false
disable_mailer
if
opts
[
:mailer
]
==
false
setup_stubs
setup_stubs
clear_test_repo_dir
if
opts
[
:init_repos
]
==
true
clear_test_repo_dir
if
opts
[
:init_repos
]
==
true
setup_test_repos
(
opts
)
if
opts
[
:repos
]
==
true
setup_test_repos
(
opts
)
if
opts
[
:repos
]
==
true
end
end
...
@@ -165,8 +164,7 @@ module TestEnv
...
@@ -165,8 +164,7 @@ module TestEnv
def
clear_test_repo_dir
def
clear_test_repo_dir
setup_stubs
setup_stubs
# Use tmp dir for FS manipulations
repos_path
=
testing_path
()
# Remove tmp/test-git-base-path
# Remove tmp/test-git-base-path
FileUtils
.
rm_rf
Gitlab
.
config
.
gitlab_shell
.
repos_path
FileUtils
.
rm_rf
Gitlab
.
config
.
gitlab_shell
.
repos_path
...
...
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