Skip to content
  • Jeff King's avatar
    rev-list: check reflog_info before showing usage · 7f97de5e
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    When git-rev-list sees no pending commits, it shows a usage
    message. This works even when reflog-walking is requested,
    because the reflog-walk code currently puts the reflog tips
    into the pending queue.
    
    In preparation for refactoring the reflog-walk code, let's
    explicitly check whether we have any reflogs to walk. For
    now this is a noop, but the existing reflog tests will make
    sure that it kicks in after the refactoring. Likewise, we'll
    add a test that "rev-list -g" without specifying any reflogs
    continues to fail (so that we know our check does not kick
    in too aggressively).
    
    Note that the implementation needs to go into its own
    sub-function, as the walk code does not expose its innards
    outside of reflog-walk.c.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    7f97de5e