Skip to content
  • Phillip Wood's avatar
    prune: mark rebase autostash and orig-head as reachable · bc7f5db8
    Phillip Wood authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Rebase records the oid of HEAD before rebasing and the commit created by
    "--autostash" in files in the rebase state directory. This means that
    the autostash commit is never reachable from any ref or reflog and when
    rebasing a detached HEAD the original HEAD can become unreachable if the
    user expires HEAD's the reflog while the rebase is running. Fix this by
    reading the relevant files when marking reachable commits.
    
    Note that it is possible for the commit recorded in
    .git/rebase-merge/amend to be unreachable but pruning that object does
    not affect the operation of "git rebase --continue" as we're only
    interested in the object id, not in the object itself.
    
    Reported-by: default avatarOrgad Shaneh <orgads@gmail.com>
    Signed-off-by: default avatarPhillip Wood <phillip.wood@dunelm.org.uk>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    bc7f5db8