Skip to content
  • Junio C Hamano's avatar
    symbolic-ref -d: do not allow removal of HEAD · 12cfa792
    Junio C Hamano authored
    If you delete the symbolic-ref HEAD from a repository, Git no longer
    considers the repository valid, and even "git symbolic-ref HEAD
    refs/heads/master" would not be able to recover from that state
    (although "git init" can, but that is a sure sign that you are
    talking about a "broken" repository).
    
    In the spirit similar to afe5d3d5
    
     ("symbolic ref: refuse non-ref
    targets in HEAD", 2009-01-29), forbid removal of HEAD to avoid
    corrupting a repository.
    
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    12cfa792