mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 21:26:07 +10:00
@@ -1,5 +1,9 @@
|
||||
module Gitlab
|
||||
class SatelliteNotExistError < StandardError; end
|
||||
class SatelliteNotExistError < StandardError
|
||||
def initialize(msg = "Satellite doesn't exist")
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
module Satellite
|
||||
class Satellite
|
||||
@@ -17,14 +21,9 @@ module Gitlab
|
||||
Gitlab::Satellite::Logger.error(message)
|
||||
end
|
||||
|
||||
def raise_no_satellite
|
||||
raise SatelliteNotExistError.new("Satellite doesn't exist")
|
||||
end
|
||||
|
||||
def clear_and_update!
|
||||
raise_no_satellite unless exists?
|
||||
raise SatelliteNotExistError unless exists?
|
||||
|
||||
File.exists? path
|
||||
@repo = nil
|
||||
clear_working_dir!
|
||||
delete_heads!
|
||||
@@ -55,7 +54,7 @@ module Gitlab
|
||||
# * Changes the current directory to the satellite's working dir
|
||||
# * Yields
|
||||
def lock
|
||||
raise_no_satellite unless exists?
|
||||
raise SatelliteNotExistError unless exists?
|
||||
|
||||
File.open(lock_file, "w+") do |f|
|
||||
begin
|
||||
@@ -77,7 +76,7 @@ module Gitlab
|
||||
end
|
||||
|
||||
def repo
|
||||
raise_no_satellite unless exists?
|
||||
raise SatelliteNotExistError unless exists?
|
||||
|
||||
@repo ||= Grit::Repo.new(path)
|
||||
end
|
||||
|
||||
@@ -29,7 +29,6 @@ module TestEnv
|
||||
disable_mailer if opts[:mailer] == false
|
||||
setup_stubs
|
||||
|
||||
|
||||
clear_test_repo_dir if opts[:init_repos] == true
|
||||
setup_test_repos(opts) if opts[:repos] == true
|
||||
end
|
||||
@@ -165,8 +164,7 @@ module TestEnv
|
||||
|
||||
def clear_test_repo_dir
|
||||
setup_stubs
|
||||
# Use tmp dir for FS manipulations
|
||||
repos_path = testing_path()
|
||||
|
||||
# Remove tmp/test-git-base-path
|
||||
FileUtils.rm_rf Gitlab.config.gitlab_shell.repos_path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user