# File lib/librarian/puppet/source/git.rb, line 27
        def cache!
          return vendor_checkout! if vendor_cached?

          if environment.local?
            raise Error, "Could not find a local copy of #{uri}#{" at #{sha}" unless sha.nil?}."
          end

          begin
            super
          rescue Librarian::Posix::CommandFailure => e
            raise Error, "Could not checkout #{uri}#{" at #{sha}" unless sha.nil?}: #{e}"
          end

          cache_in_vendor(repository.path) if environment.vendor?
        end