diff --git a/fsck-cache.c b/fsck-cache.c index bb2b867611..34c80811c9 100644 --- a/fsck-cache.c +++ b/fsck-cache.c @@ -108,6 +108,9 @@ static void mark_reachable(struct revision *rev) { struct parent *p = rev->parent; + /* If we've been here already, don't bother */ + if (rev->flags & REACHABLE) + return; rev->flags |= REACHABLE | USED; while (p) { mark_reachable(p->parent);