def submodules(options = {})
      ref = options[:ref]

      modules = []
      IniParse.parse(`git show #{ref}:.gitmodules 2> #{File::NULL}`).each do |section|
        # git < 1.8.5 does not update the .gitmodules file with submodule
        # changes, so when we are looking at the current state of the work tree,
        # we need to check if the submodule actually exists via another method,
        # since the .gitmodules file we parsed does not represent reality.
        if ref.nil? && GIT_VERSION < '1.8.5'
          result = Overcommit::Utils.execute(%W[
            git submodule status #{section['path']}
          ])
          next unless result.success?
        end

        modules << Submodule.new(section['path'], section['url'])
      end

      modules
    rescue IniParse::IniParseError => ex
      raise Overcommit::Exceptions::GitSubmoduleError,
            "Unable to read submodule information from #{ref}:.gitmodules file: #{ex.message}"
    end
def submodules(options = {})
      ref = options[:ref]

      modules = []
      IniParse.parse(`git show #{ref}:.gitmodules 2> #{File::NULL}`).each do |section|
        # git < 1.8.5 does not update the .gitmodules file with submodule
        # changes, so when we are looking at the current state of the work tree,
        # we need to check if the submodule actually exists via another method,
        # since the .gitmodules file we parsed does not represent reality.
        if ref.nil? && GIT_VERSION < '1.8.5'
          result = Overcommit::Utils.execute(%W[
            git submodule status #{section['path']}
          ])
          next unless result.success?
        end

        modules << Submodule.new(section['path'], section['url'])
      end

      modules
    rescue IniParse::IniParseError => ex
      raise Overcommit::Exceptions::GitSubmoduleError,
            "Unable to read submodule information from #{ref}:.gitmodules file: #{ex.message}"
    end
Returns the current set of registered submodules.

 @param options [Hash]
 @return [Array<Overcommit::GitRepo::Submodule>]