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 | 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 | 8 | module Satellite |
5 | 9 | class Satellite |
... | ... | @@ -17,14 +21,9 @@ module Gitlab |
17 | 21 | Gitlab::Satellite::Logger.error(message) |
18 | 22 | end |
19 | 23 | |
20 | - def raise_no_satellite | |
21 | - raise SatelliteNotExistError.new("Satellite doesn't exist") | |
22 | - end | |
23 | - | |
24 | 24 | def clear_and_update! |
25 | - raise_no_satellite unless exists? | |
25 | + raise SatelliteNotExistError unless exists? | |
26 | 26 | |
27 | - File.exists? path | |
28 | 27 | @repo = nil |
29 | 28 | clear_working_dir! |
30 | 29 | delete_heads! |
... | ... | @@ -55,7 +54,7 @@ module Gitlab |
55 | 54 | # * Changes the current directory to the satellite's working dir |
56 | 55 | # * Yields |
57 | 56 | def lock |
58 | - raise_no_satellite unless exists? | |
57 | + raise SatelliteNotExistError unless exists? | |
59 | 58 | |
60 | 59 | File.open(lock_file, "w+") do |f| |
61 | 60 | begin |
... | ... | @@ -77,7 +76,7 @@ module Gitlab |
77 | 76 | end |
78 | 77 | |
79 | 78 | def repo |
80 | - raise_no_satellite unless exists? | |
79 | + raise SatelliteNotExistError unless exists? | |
81 | 80 | |
82 | 81 | @repo ||= Grit::Repo.new(path) |
83 | 82 | end | ... | ... |
spec/support/test_env.rb
... | ... | @@ -29,7 +29,6 @@ module TestEnv |
29 | 29 | disable_mailer if opts[:mailer] == false |
30 | 30 | setup_stubs |
31 | 31 | |
32 | - | |
33 | 32 | clear_test_repo_dir if opts[:init_repos] == true |
34 | 33 | setup_test_repos(opts) if opts[:repos] == true |
35 | 34 | end |
... | ... | @@ -165,8 +164,7 @@ module TestEnv |
165 | 164 | |
166 | 165 | def clear_test_repo_dir |
167 | 166 | setup_stubs |
168 | - # Use tmp dir for FS manipulations | |
169 | - repos_path = testing_path() | |
167 | + | |
170 | 168 | # Remove tmp/test-git-base-path |
171 | 169 | FileUtils.rm_rf Gitlab.config.gitlab_shell.repos_path |
172 | 170 | ... | ... |