Sha256: 73a5f3b5299a742625dc80e77ab7ac32649e45d44b3320e0d6569e6e8e030a44
Contents?: true
Size: 988 Bytes
Versions: 23
Compression:
Stored size: 988 Bytes
Contents
# frozen_string_literal: true require 'avm/scms/commit_info' require 'avm/git/scms/git/changed_file' require 'eac_ruby_utils/core_ext' module Avm module Git module Scms class Git < ::Avm::Scms::Base class CommitDirty enable_method_class # @param commit_info [Avm::Scms::CommitInfo, nil] common_constructor :scm, :commit_info, default: [nil] delegate :git_repo, :head_commit, :run_commit, to: :scm # @return [Avm::Git::Scms::Git::Commit,nil] def result return nil unless git_repo.dirty? run_commit(asserted_commit_info) head_commit end private def asserted_commit_info r = ::Avm::Scms::CommitInfo.assert(commit_info) r = r.message(COMMIT_DIRTY_DEFAULT_MESSAGE) if r.message.blank? git_repo.dirty_files.inject(r) { |a, e| a.path(e.absolute_path) } end end end end end end
Version data entries
23 entries across 23 versions & 2 rubygems