Re: [PATCH 3/3] branch: forbid refs/heads/HEAD
- From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
- Date
- Oct 22, 2017, 05:00 UTC
- Message-ID
- <1508648422.2152.7.camel@gmail.com>
- In-Reply-To
- <xmqqpo9gg9pa.fsf@gitster.mtv.corp.google.com>
On Sat, 2017-10-21 at 17:57 +0900, Junio C Hamano wrote:
> ... The code may already > handle it, or there may need even more code to support the rename; I > didn't check. >
As far as I could see there the code does seem to already handle the rename. This part of builtin/branch.c is what seems to be ensuring that,
if (strbuf_check_branch_ref(&oldref, oldname)) {
/*
* Bad name --- this could be an attempt to rename a
* ref that we used to allow to be created by accident.
*/
if (ref_exists(oldref.buf))
recovery = 1;
else
die(_("Invalid branch name: '%s'"), oldname);
}-- Kaartic