Sha256: 62fab496cb5f3926d97b5c9bd223132d12bea0aa9ca647ec24c5e45ad46f2c0d

Contents?: true

Size: 796 Bytes

Versions: 54

Compression:

Stored size: 796 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module Avm
  module Git
    module Scms
      class Git < ::Avm::Scms::Base
        class ChangeTracker
          common_constructor :git_scm, :commit_info
          attr_reader :starting_commit
          delegate :git_repo, to: :git_scm

          def start
            raise 'Repository is dirty' if git_repo.dirty?

            self.starting_commit = git_repo.head
          end

          # @return [Avm::Git::Scms::Git::Commit, nil]
          def stop
            git_scm.commit_dirty
            return nil if starting_commit == git_repo.head

            git_scm.reset_and_commit(starting_commit, commit_info)
          end

          private

          attr_writer :starting_commit
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
eac_tools-0.80.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.79.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.78.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.77.1 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.77.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.76.1 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.76.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.75.2 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
avm-git-0.13.4 lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.75.1 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.75.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.74.1 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.74.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.73.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.72.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.70.1 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.70.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.69.1 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.69.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb
eac_tools-0.68.0 sub/avm-git/lib/avm/git/scms/git/change_tracker.rb