Sha256: d329f7130b189af45c8f3cac696a2264c7f0162b646a80505fc2c0c816c2bd79

Contents?: true

Size: 866 Bytes

Versions: 67

Compression:

Stored size: 866 Bytes

Contents

# frozen_string_literal: true

require 'avm/scms/base'
require 'eac_git/local'
require 'eac_ruby_utils/core_ext'

module Avm
  module Git
    module Scms
      class GitSubrepo < ::Avm::Scms::Base
        delegate :commit_if_change, to: :parent_scm

        def update
          git_subrepo.command('clean').execute!
          git_subrepo.command('pull').execute!
        end

        # @return [EacGit::Local]
        def git_repo
          @git_repo ||= ::EacGit::Local.find(path)
        end

        # @return [EacGit::Local::Subrepo]
        def git_subrepo
          @git_subrepo ||= git_repo.subrepo(subpath)
        end

        # @return [Pathname]
        def subpath
          path.expand_path.relative_path_from(git_repo.root_path.expand_path)
        end

        def valid?
          path.join('.gitrepo').file?
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 3 rubygems

Version Path
eac_tools-0.49.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.48.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.48.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.47.2 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.47.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.10.1 lib/avm/git/scms/git_subrepo.rb
eac_tools-0.47.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.46.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.45.2 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.45.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.45.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.44.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.43.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.42.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.10.0 lib/avm/git/scms/git_subrepo.rb
eac_tools-0.41.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.40.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.9.0 lib/avm/git/scms/git_subrepo.rb
eac_tools-0.39.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.38.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb