'Test clone() doesn\'t crash if HEAD points to a non-existing ref.
This simulates cloning server-side bare repository either when it is
still empty or if user renames master branch and pushes private repo
to the server.
Non-bare repo HEAD always points to an existing ref.'

def test_clone_empty(self):

    r = self.open_repo('empty.git')
    tmp_dir = self.mkdtemp()
    self.addCleanup(shutil.rmtree, tmp_dir)
    r.clone(tmp_dir, mkdir=False, bare=True)
