Commit d66d10970d2dcd4a6be0de6fef2274e4eefa5657
Exists in
spb-stable
and in
3 other branches
Merge pull request #6594 from tsigo/rs-small-changes
Small changes
Showing
2 changed files
with
9 additions
and
12 deletions
Show diff stats
lib/gitlab/satellite/satellite.rb
1 | module Gitlab | 1 | module Gitlab |
2 | - class SatelliteNotExistError < StandardError; end | 2 | + class SatelliteNotExistError < StandardError |
3 | + def initialize(msg = "Satellite doesn't exist") | ||
4 | + super | ||
5 | + end | ||
6 | + end | ||
3 | 7 | ||
4 | module Satellite | 8 | module Satellite |
5 | class Satellite | 9 | class Satellite |
@@ -17,14 +21,9 @@ module Gitlab | @@ -17,14 +21,9 @@ module Gitlab | ||
17 | Gitlab::Satellite::Logger.error(message) | 21 | Gitlab::Satellite::Logger.error(message) |
18 | end | 22 | end |
19 | 23 | ||
20 | - def raise_no_satellite | ||
21 | - raise SatelliteNotExistError.new("Satellite doesn't exist") | ||
22 | - end | ||
23 | - | ||
24 | def clear_and_update! | 24 | def clear_and_update! |
25 | - raise_no_satellite unless exists? | 25 | + raise SatelliteNotExistError unless exists? |
26 | 26 | ||
27 | - File.exists? path | ||
28 | @repo = nil | 27 | @repo = nil |
29 | clear_working_dir! | 28 | clear_working_dir! |
30 | delete_heads! | 29 | delete_heads! |
@@ -55,7 +54,7 @@ module Gitlab | @@ -55,7 +54,7 @@ module Gitlab | ||
55 | # * Changes the current directory to the satellite's working dir | 54 | # * Changes the current directory to the satellite's working dir |
56 | # * Yields | 55 | # * Yields |
57 | def lock | 56 | def lock |
58 | - raise_no_satellite unless exists? | 57 | + raise SatelliteNotExistError unless exists? |
59 | 58 | ||
60 | File.open(lock_file, "w+") do |f| | 59 | File.open(lock_file, "w+") do |f| |
61 | begin | 60 | begin |
@@ -77,7 +76,7 @@ module Gitlab | @@ -77,7 +76,7 @@ module Gitlab | ||
77 | end | 76 | end |
78 | 77 | ||
79 | def repo | 78 | def repo |
80 | - raise_no_satellite unless exists? | 79 | + raise SatelliteNotExistError unless exists? |
81 | 80 | ||
82 | @repo ||= Grit::Repo.new(path) | 81 | @repo ||= Grit::Repo.new(path) |
83 | end | 82 | end |
spec/support/test_env.rb
@@ -29,7 +29,6 @@ module TestEnv | @@ -29,7 +29,6 @@ module TestEnv | ||
29 | disable_mailer if opts[:mailer] == false | 29 | disable_mailer if opts[:mailer] == false |
30 | setup_stubs | 30 | setup_stubs |
31 | 31 | ||
32 | - | ||
33 | clear_test_repo_dir if opts[:init_repos] == true | 32 | clear_test_repo_dir if opts[:init_repos] == true |
34 | setup_test_repos(opts) if opts[:repos] == true | 33 | setup_test_repos(opts) if opts[:repos] == true |
35 | end | 34 | end |
@@ -165,8 +164,7 @@ module TestEnv | @@ -165,8 +164,7 @@ module TestEnv | ||
165 | 164 | ||
166 | def clear_test_repo_dir | 165 | def clear_test_repo_dir |
167 | setup_stubs | 166 | setup_stubs |
168 | - # Use tmp dir for FS manipulations | ||
169 | - repos_path = testing_path() | 167 | + |
170 | # Remove tmp/test-git-base-path | 168 | # Remove tmp/test-git-base-path |
171 | FileUtils.rm_rf Gitlab.config.gitlab_shell.repos_path | 169 | FileUtils.rm_rf Gitlab.config.gitlab_shell.repos_path |
172 | 170 |