summaryrefslogtreecommitdiff
path: root/t/t5150-request-pull.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2011-06-03 01:11:13 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-06-05 17:53:10 -0700
commit61adfd30974a6c49b3d07275e9f2c9fc44bf779c (patch)
treefa3479c921c9e30ae8af63586f088e2b9ff7850b /t/t5150-request-pull.sh
parentt: add tests for cloning remotes with detached HEAD (diff)
downloadtgif-61adfd30974a6c49b3d07275e9f2c9fc44bf779c.tar.xz
consider only branches in guess_remote_head
The guess_remote_head function tries to figure out where a remote's HEAD is pointing by comparing the sha1 of the remote's HEAD with the sha1 of various refs found on the remote. However, we were too liberal in matching refs, and would match tags or remote tracking branches, even though these things could not possibly be referenced by the HEAD symbolic ref (since git will detach when checking them out). As a result, a clone of a remote repository with a detached HEAD might write "refs/tags/*" into our local HEAD, which is bogus. The resulting HEAD should be detached. The other related code path is remote.c's get_head_names() (which is used for, among other things, "set-head -a"). This was not affected, however, as that function feeds only refs from refs/heads to guess_remote_head. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5150-request-pull.sh')
0 files changed, 0 insertions, 0 deletions