Sha256: 7c09ec7c98d47128d9923c2aadd380ae523ec8eea53d265755d2595680fb0f27

Contents?: true

Size: 921 Bytes

Versions: 109

Compression:

Stored size: 921 Bytes

Contents

# frozen_string_literal: true

require 'avm/launcher/git/base'

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

        def initialize(target_path, source_path, source_rev)
          super(target_path)
          @target_git = ::Avm::Launcher::Git::Base.new(self)
          @source_git = ::Avm::Launcher::Git::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

109 entries across 109 versions & 2 rubygems

Version Path
avm-tools-0.140.0 lib/avm/launcher/git/mirror_update.rb
eac_tools-0.36.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
avm-tools-0.139.0 lib/avm/launcher/git/mirror_update.rb
eac_tools-0.35.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
avm-tools-0.138.0 lib/avm/launcher/git/mirror_update.rb
eac_tools-0.34.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
avm-tools-0.137.0 lib/avm/launcher/git/mirror_update.rb
eac_tools-0.33.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
eac_tools-0.32.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
avm-tools-0.136.2 lib/avm/launcher/git/mirror_update.rb
eac_tools-0.31.1 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
eac_tools-0.31.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
avm-tools-0.136.1 lib/avm/launcher/git/mirror_update.rb
eac_tools-0.30.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
eac_tools-0.29.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
avm-tools-0.136.0 lib/avm/launcher/git/mirror_update.rb
eac_tools-0.28.0 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
eac_tools-0.27.2 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
eac_tools-0.27.1 sub/avm-tools/lib/avm/launcher/git/mirror_update.rb
avm-tools-0.135.0 lib/avm/launcher/git/mirror_update.rb