class Bundler::Source::Git::GitProxy

def copy_to(destination, submodules=false)

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((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