From: Jeff King Date: Tue, 19 Jun 2012 14:47:12 GMT Subject: Re: [PATCH] symbolic-ref: check format of given reference Message-ID: <20120619144712.GB12085@sigill.intra.peff.net> In-Reply-To: <7vipeo4kcp.fsf@alter.siamese.dyndns.org> On Mon, Jun 18, 2012 at 10:10:14AM -0700, Junio C Hamano wrote: > For that matter, shouldn't symbolic-ref be forbidden to point > outside refs/heads/, not just restricted in refs/ like the current > code does? We tried that already but reverted it due to topgit. See: commit e9cc02f0e41fd5d2f51e3c3f2b4f8cfa9e434432 Author: Jeff King Date: Fri Feb 13 13:26:09 2009 -0500 symbolic-ref: allow refs/ in HEAD Commit afe5d3d5 introduced a safety valve to symbolic-ref to disallow installing an invalid HEAD. It was accompanied by b229d18a, which changed validate_headref to require that HEAD contain a pointer to refs/heads/ instead of just refs/. Therefore, the safety valve also checked for refs/heads/. As it turns out, topgit is using refs/top-bases/ in HEAD, leading us to re-loosen (at least temporarily) the validate_headref check made in b229d18a. This patch does the corresponding loosening for the symbolic-ref safety valve, so that the two are in agreement once more. -Peff