From: Jeff King Date: Fri, 3 Jun 2011 05:10:10 +0000 (-0400) Subject: t: add tests for cloning remotes with detached HEAD X-Git-Tag: v1.7.7-rc0~59^2~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/3b368546a0da81aa44d8c46eb40a7e7b955cab65?hp=3b368546a0da81aa44d8c46eb40a7e7b955cab65 t: add tests for cloning remotes with detached HEAD We didn't test this setup at all, and doing so reveals a few bugs: 1. Cloning a repository with an orphaned detached HEAD (i.e., one that points to history that is not referenced by any ref) will fail. 2. Cloning a repository with a detached HEAD that points to a tag will cause us to write a bogus "refs/tags/..." ref into the HEAD symbolic ref. We should probably detach instead. 3. Cloning a repository with a detached HEAD that points to a branch will cause us to checkout that branch. This is a known limitation of the git protocol (we have to guess at HEAD's destination, since the symref contents aren't shown to us). This test serves to document the desired behavior, which can only be achieved once the git protocol learns to share symref information. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano ---