module EacLauncher module Git # Métodos abstratos: # * source_instance # * source_remote_name # * current_ref class TransposeBase < ::EacLauncher::Path include ::Eac::SimpleCache TARGET_REMOTE = 'target'.freeze def initialize(instance) @instance = instance cache_git.git.reset_hard(current_ref) cache_git.assert_remote_url(TARGET_REMOTE, target_remote_url) super(path) end protected attr_reader :instance def update ::EacLauncher::Git::MirrorUpdate.new( path, source_instance, source_instance.options.git_current_revision ) end def path instance.cache_path('git_repository') end def source_git_uncached ::EacLauncher::Git::Base.new(source_instance) end def cache_git_uncached ::EacLauncher::Git::Base.new(update) end def target_remote_url ::EacLauncher::Vendor::Github.to_ssh_url(source_git.git.remote(source_remote_name).url) end end end end