# File lib/bundler/source/git/git_proxy.rb, line 81
        def copy_to(destination, submodules=false)
          unless File.exist?(destination.join(".git"))
            FileUtils.mkdir_p(destination.dirname)
            FileUtils.rm_rf(destination)
            git_retry %|clone --no-checkout --quiet "#{path}" "#{destination}"|
            File.chmod(((File.stat(destination).mode | 0777) & ~File.umask), destination)
          end

          SharedHelpers.chdir(destination) do
            git_retry %|fetch --force --quiet --tags "#{path}"|
            git "reset --hard #{@revision}"

            if submodules
              git_retry "submodule update --init --recursive"
            end
          end
        end