Sha256: 0eab8cd20d5234e909c2c594d1460426536e54b5b40e9fc2060d06d99e5e9745

Contents?: true

Size: 849 Bytes

Versions: 87

Compression:

Stored size: 849 Bytes

Contents

# frozen_string_literal: true

require 'eac_launcher/git/base'

module EacLauncher
  module Git
    class MirrorUpdate < ::EacLauncher::Paths::Real
      include ::EacRubyUtils::SimpleCache

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

Version data entries

87 entries across 87 versions & 2 rubygems

Version Path
avm-tools-0.99.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.98.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.97.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.96.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.95.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.94.3 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.94.2 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.94.1 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.94.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.93.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.92.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.91.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.90.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.89.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.88.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.87.1 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.87.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.86.0 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.85.1 lib/eac_launcher/git/mirror_update.rb
avm-tools-0.85.0 lib/eac_launcher/git/mirror_update.rb