class Avm::Git::Launcher::WarpBase

  • current_ref
    * source_remote_name
    * source_instance
    Métodos abstratos:

def cache_git_uncached

def cache_git_uncached
  ::Avm::Git::Launcher::Base.new(update)
end

def initialize(instance)

def initialize(instance)
  @instance = instance
  cache_git.git.reset_hard(current_ref)
  cache_git.remote(TARGET_REMOTE).url = target_remote_url
  super(path)
end

def path

def path
  instance.cache_path('git_repository')
end

def source_git_uncached

def source_git_uncached
  ::Avm::Git::Launcher::Base.new(source_instance.real)
end

def target_remote_url

def target_remote_url
  ::Avm::Git::Vendor::Github.to_ssh_url(source_git.git.remote(source_remote_name).url)
end

def update

def update
  validate_source_current_revision
  ::Avm::Git::Launcher::MirrorUpdate.new(
    path,
    source_instance.real,
    source_instance.options.git_current_revision
  )
end

def validate_source_current_revision

def validate_source_current_revision
  if source_git.rev_parse(source_instance.options.git_current_revision, false).present?
    return
  end
  raise ::Avm::Launcher::Instances::Error, 'Refspec ' \
    "\"#{source_instance.options.git_current_revision}\" not found in \"#{source_git}\""
end