Thread (2 messages) flat view 2 messages, 2 authors, 2017-10-22

Re: [PATCH 3/3] branch: forbid refs/heads/HEAD

From: Kaartic Sivaraam <hidden>
Date: 2017-10-22 05:06:49

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help