class Bundler::Source::Git

def checkout

def checkout
  unless File.exist?(path.join(".git"))
    FileUtils.mkdir_p(path.dirname)
    FileUtils.rm_rf(path)
    git %|clone --no-checkout "#{cache_path}" "#{path}"|
    File.chmod((0777 & ~File.umask), path)
  end
  Dir.chdir(path) do
    git %|fetch --force --quiet --tags "#{cache_path}"|
    git "reset --hard #{revision}"
    if @submodules
      git "submodule init"
      git "submodule update"
    end
  end
end