From: Jeff King Date: Thu, 14 Feb 2019 04:38:21 +0000 (-0500) Subject: prune: check SEEN flag for reachability X-Git-Tag: v2.22.0-rc0~168^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c2bf473d0d60f44a22a724871ada7981e51606f9?hp=c2bf473d0d60f44a22a724871ada7981e51606f9 prune: check SEEN flag for reachability 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: Jeff King Signed-off-by: Junio C Hamano ---