Sha256: a0d03d00e6cffd86d47443cc22bd1bc329f1993ef693449027d69149722a7b67
Contents?: true
Size: 934 Bytes
Versions: 31
Compression:
Stored size: 934 Bytes
Contents
module Overcommit::Hook::Shared # Shared code used by all `SubmoduleStatus` hooks to notify the user if any # submodules are uninitialized, out of date with the current index, or contain # merge conflicts. module SubmoduleStatus def run messages = [] submodule_statuses.each do |submodule_status| path = submodule_status.path if submodule_status.uninitialized? messages << "Submodule #{path} is uninitialized." elsif submodule_status.outdated? messages << "Submodule #{path} is out of date with the current index." elsif submodule_status.merge_conflict? messages << "Submodule #{path} has merge conflicts." end end return :pass if messages.empty? [:warn, messages.join("\n")] end private def submodule_statuses Overcommit::GitRepo.submodule_statuses(recursive: config['recursive']) end end end
Version data entries
31 entries across 29 versions & 2 rubygems