From: Junio C Hamano Date: Sun, 01 Jul 2007 02:22:04 GMT Subject: Re: [PATCH] git-clone: fetch possibly detached HEAD over dumb http Message-ID: <7vy7i0amnn.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20070630222336.GA2703@steel.home> Alex Riesen writes: > The check for .git validity includes checking if HEAD contains > something sane, and this check is very simple: the HEAD is read > (readlink(2) or plain read(2)) and tested if it contains a > reference starting with "refs/", which maybe inconsistent with > resolve_gitlink_ref, but probably ok. Ah, I was not paying close attention to resolve_gitlink_ref(); if it does not require HEAD to point at refs/ I would say it is a bug. Come to think of it, I would further say that we probably should tighten it up a bit: HEAD must be either a valid commit object name (i.e. detached) or a ref that point at somewhere under refs/heads hierarchy, not just anywhere in refs/.