Sha256: 2d85a487cdfaed40f78c4f38feedc6e6dbc166d6790fa9614631a456a65565c6

Contents?: true

Size: 921 Bytes

Versions: 100

Compression:

Stored size: 921 Bytes

Contents

# frozen_string_literal: true

require 'avm/git/launcher/base'

module Avm
  module Git
    module Launcher
      class MirrorUpdate < ::Avm::Launcher::Paths::Real
        include ::EacRubyUtils::SimpleCache

        def initialize(target_path, source_path, source_rev)
          super(target_path)
          @target_git = ::Avm::Git::Launcher::Base.new(self)
          @source_git = ::Avm::Git::Launcher::Base.new(source_path)
          @source_rev = source_rev
          run
        end

        private

        def run
          fetch_remote_source
          reset_source_rev
        end

        def fetch_remote_source
          @target_git.git
          @target_git.assert_remote_url('origin', @source_git)
          @target_git.fetch('origin', tags: true)
        end

        def reset_source_rev
          @target_git.reset_hard(@source_git.rev_parse(@source_rev, true))
        end
      end
    end
  end
end

Version data entries

100 entries across 100 versions & 2 rubygems

Version Path
avm-git-0.18.0 lib/avm/git/launcher/mirror_update.rb
eac_tools-0.94.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
avm-git-0.17.0 lib/avm/git/launcher/mirror_update.rb
eac_tools-0.86.5 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
avm-git-0.16.0 lib/avm/git/launcher/mirror_update.rb
eac_tools-0.86.4 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.86.3 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
avm-git-0.15.0 lib/avm/git/launcher/mirror_update.rb
eac_tools-0.86.2 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.84.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.83.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.82.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
avm-git-0.14.0 lib/avm/git/launcher/mirror_update.rb
eac_tools-0.81.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.80.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.79.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.78.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.77.1 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.77.0 sub/avm-git/lib/avm/git/launcher/mirror_update.rb
eac_tools-0.76.1 sub/avm-git/lib/avm/git/launcher/mirror_update.rb