Skip to content

Commit 2845dbe

Browse files
author
Linus Torvalds
committed
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.
1 parent d9839e0 commit 2845dbe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fsck-cache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ static void mark_reachable(struct revision *rev)
108108
{
109109
struct parent *p = rev->parent;
110110

111+
/* If we've been here already, don't bother */
112+
if (rev->flags & REACHABLE)
113+
return;
111114
rev->flags |= REACHABLE | USED;
112115
while (p) {
113116
mark_reachable(p->parent);

0 commit comments

Comments
 (0)