• Duy Nguyen's avatar
    status: show more info than "currently not on any branch" · b397ea48
    Duy Nguyen authored
    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: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
    b397ea48
wt-status.h 2.3 KB