Module: Overcommit::Hook::Shared::SubmoduleStatus
- Included in:
- PostCheckout::SubmoduleStatus, PostCommit::SubmoduleStatus, PostMerge::SubmoduleStatus, PostRewrite::SubmoduleStatus
- Defined in:
- lib/overcommit/hook/shared/submodule_status.rb
Overview
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.
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/overcommit/hook/shared/submodule_status.rb', line 8 def run = [] submodule_statuses.each do |submodule_status| path = submodule_status.path if submodule_status.uninitialized? << "Submodule #{path} is uninitialized." elsif submodule_status.outdated? << "Submodule #{path} is out of date with the current index." elsif submodule_status.merge_conflict? << "Submodule #{path} has merge conflicts." end end return :pass if .empty? [:warn, .join("\n")] end |