Class: Overcommit::Hook::PostCheckout::SubmoduleStatus
- Defined in:
- lib/overcommit/hook/post_checkout/submodule_status.rb
Overview
Checks the status of submodules in the current repository and notifies the user if any are uninitialized, out of date with the current index, or contain merge conflicts.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#applicable_files, #command, #description, #enabled?, #execute, #execute_in_background, #flags, #in_path?, #initialize, #name, #process_hook_return_value, #quiet?, #required?, #required_executable, #required_libraries, #run?, #run_and_transform, #skip?
Constructor Details
This class inherits a constructor from Overcommit::Hook::Base
Instance Method Details
#run ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/overcommit/hook/post_checkout/submodule_status.rb', line 6 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 |