Skip to content
  • Jeff King's avatar
    prune: check SEEN flag for reachability · c2bf473d
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The git-prune command checks reachability by doing a traversal, and then
    checking whether a given object exists in the global object hash. This
    can yield false positives if any other part of the code had to create an
    object struct for some reason. It's not clear whether this is even
    possible, but it's more robust to rely on something a little more
    concrete: the SEEN flag set by our traversal.
    
    Note that there is a slight possibility of regression here, as we're
    relying on mark_reachable_objects() to consistently set the flag.
    However, it has always done so, and we're already relying on that fact
    in prune_shallow(), which is called as part of git-prune. So this is
    making these two parts of the prune operation more consistent.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    c2bf473d