Commit f23dcac91b12a0873a6f3463ecc7f5ee3afc46a1
Exists in
spb-stable
and in
3 other branches
Merge branch 'ensure_satellite_exists' into 'master'
Ensure satellite exists instead of raising an error
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
lib/gitlab/satellite/satellite.rb
| @@ -22,7 +22,7 @@ module Gitlab | @@ -22,7 +22,7 @@ module Gitlab | ||
| 22 | end | 22 | end |
| 23 | 23 | ||
| 24 | def clear_and_update! | 24 | def clear_and_update! |
| 25 | - raise SatelliteNotExistError unless exists? | 25 | + project.ensure_satellite_exists |
| 26 | 26 | ||
| 27 | @repo = nil | 27 | @repo = nil |
| 28 | clear_working_dir! | 28 | clear_working_dir! |
| @@ -54,7 +54,7 @@ module Gitlab | @@ -54,7 +54,7 @@ module Gitlab | ||
| 54 | # * Changes the current directory to the satellite's working dir | 54 | # * Changes the current directory to the satellite's working dir |
| 55 | # * Yields | 55 | # * Yields |
| 56 | def lock | 56 | def lock |
| 57 | - raise SatelliteNotExistError unless exists? | 57 | + project.ensure_satellite_exists |
| 58 | 58 | ||
| 59 | File.open(lock_file, "w+") do |f| | 59 | File.open(lock_file, "w+") do |f| |
| 60 | begin | 60 | begin |
| @@ -76,7 +76,7 @@ module Gitlab | @@ -76,7 +76,7 @@ module Gitlab | ||
| 76 | end | 76 | end |
| 77 | 77 | ||
| 78 | def repo | 78 | def repo |
| 79 | - raise SatelliteNotExistError unless exists? | 79 | + project.ensure_satellite_exists |
| 80 | 80 | ||
| 81 | @repo ||= Grit::Repo.new(path) | 81 | @repo ||= Grit::Repo.new(path) |
| 82 | end | 82 | end |