From: Linus Torvalds Date: Wed, 13 Apr 2005 19:35:08 +0000 (-0700) Subject: Make fsck reachability avoid doing unnecessary work for X-Git-Tag: v0.99~887 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2845dbe4a451b20f963f872c3914b9184142ff3f;p=git.git Make fsck reachability avoid doing unnecessary work for parents that we reach multiple ways. This doesn't matter right now. It _will_ matter once we have complex revision graphs. --- diff --git a/fsck-cache.c b/fsck-cache.c index bb2b86761..34c80811c 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);