summaryrefslogtreecommitdiff
path: root/fsck-cache.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-13 19:35:08 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-13 19:35:08 (GMT)
commit2845dbe4a451b20f963f872c3914b9184142ff3f (patch)
tree8caa89079f408d056c20ae13a2a62cb2148ccd2c /fsck-cache.c
parentd9839e030592292267e6317fba308383e0012001 (diff)
downloadgit-2845dbe4a451b20f963f872c3914b9184142ff3f.zip
git-2845dbe4a451b20f963f872c3914b9184142ff3f.tar.gz
git-2845dbe4a451b20f963f872c3914b9184142ff3f.tar.bz2
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.
Diffstat (limited to 'fsck-cache.c')
-rw-r--r--fsck-cache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fsck-cache.c b/fsck-cache.c
index bb2b867..34c8081 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);