Skip to content
  • Duy Nguyen's avatar
    status: show more info than "currently not on any branch" · b397ea48
    Duy Nguyen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    When a remote ref or a tag is checked out, HEAD is automatically
    detached. There is no user-friendly way to find out what ref is
    checked out in this case. This patch digs in reflog for this
    information and shows "HEAD detached from origin/master" or "HEAD
    detached at v1.8.0" instead of "currently not on any branch".
    
    When it cannot figure out the original ref, it shows an abbreviated
    SHA-1. "Currently not on any branch" would never display (unless
    reflog is pruned to near empty that the last checkout entry is lost).
    
    Signed-off-by: default avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b397ea48