Sha256: 9b8aa1f7f1761d2b67f65559614d41a9c2d528e9ddfef5346fbbfd2cceb3e24c

Contents?: true

Size: 879 Bytes

Versions: 20

Compression:

Stored size: 879 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
        def commit_if_change(_message)
          nyi
        end

        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

20 entries across 20 versions & 2 rubygems

Version Path
avm-tools-0.116.2 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.116.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.116.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.115.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.114.2 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.114.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.3.2 lib/avm/git/scms/git_subrepo.rb
avm-tools-0.114.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.3.1 lib/avm/git/scms/git_subrepo.rb
avm-tools-0.113.6 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.113.5 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.113.4 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.113.3 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.113.2 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.3.0 lib/avm/git/scms/git_subrepo.rb
avm-git-0.2.0 lib/avm/git/scms/git_subrepo.rb
avm-tools-0.110.0 vendor/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-tools-0.109.1 vendor/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.1.0 lib/avm/git/scms/git_subrepo.rb
avm-tools-0.109.0 vendor/avm-git/lib/avm/git/scms/git_subrepo.rb