• S
    Display an error from update-ref if target ref name is invalid. · 818f477c
    Shawn Pearce 提交于
    Alex Riesen (raa.lkml@gmail.com) recently observed that git branch
    would fail with no error message due to unexpected situations with
    regards to refs.  For example, if .git/refs/heads/gu is a file but
    "git branch -b refs/heads/gu/fixa HEAD" was invoked by the user
    it would fail silently due to refs/heads/gu being a file and not
    a directory.
    
    This change adds a test for trying to create a ref within a directory
    that is actually currently a file, and adds error printing within
    the ref locking routine should the resolve operation fail.
    
    The error printing code probably belongs at this level of the library
    as other failures within the ref locking, writing and logging code
    are also currently at this level of the code.
    Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
    Signed-off-by: NJunio C Hamano <junkio@cox.net>
    818f477c
refs.c 12.5 KB