• SZEDER Gábor's avatar
    reflog: continue walking the reflog past root commits · 71abeb75
    SZEDER Gábor authored
    If a repository contains more than one root commit, then its HEAD
    reflog may contain multiple "creation events", i.e. entries whose
    "from" value is the null sha1.  Listing such a reflog currently stops
    prematurely at the first such entry, even when the reflog still
    contains older entries.  This can scare users into thinking that their
    reflog got truncated after 'git checkout --orphan'.
    
    Continue walking the reflog past such creation events based on the
    preceeding reflog entry's "new" value.
    
    The test 'symbolic-ref writes reflog entry' in t1401-symbolic-ref
    implicitly relies on the current behavior of the reflog walker to stop
    at a root commit and thus to list only the reflog entries that are
    relevant for that test.  Adjust the test to explicitly specify the
    number of relevant reflog entries to be listed.
    Reported-by: default avatarPatrik Gustafsson <pvn@textalk.se>
    Signed-off-by: default avatarSZEDER Gábor <szeder@ira.uka.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    71abeb75
reflog-walk.c 8.5 KB