Speed up reflog pruning of unreachable commits
authorJunio Hamano <gitster@pobox.com>
Tue, 31 Mar 2009 04:34:14 +0000 (21:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Apr 2009 19:35:12 +0000 (12:35 -0700)
commit494fbfe87ade4658cb5c3a061a5be5d6f6496607
treee9ab04ec030937eca79c333ced066dea6d7d689f
parent666e07e69703c3930a60fbb1a74ed9923d293f16
Speed up reflog pruning of unreachable commits

Instead of doing the (potentially very expensive) "in_merge_base()"
check for each commit that might be pruned if it is unreachable, do a
preparatory reachability graph of the commit space, so that the common
case of being reachable can be tested directly.

[ Cleaned up a bit and tweaked to actually work.  - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-reflog.c